M
M
Mors Clamor2019-09-22 21:32:18
Yii
Mors Clamor, 2019-09-22 21:32:18

Yii2 why does not include styles work?

Hello. Made Asset :

<?php
/**
 * @link http://www.yiiframework.com/
 * @copyright Copyright (c) 2008 Yii Software LLC
 * @license http://www.yiiframework.com/license/
 */

namespace app\assets;

use yii\web\AssetBundle;

/**
 * Main application asset bundle.
 *
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @since 2.0
 */
class ProfileAsset extends AssetBundle
{
    public $basePath = '@webroot';
    public $baseUrl = '@web';
    public $css = [
        'https://fonts.googleapis.com/css?family=Roboto+Condensed',
        'http://yii2.loc/web/css/bootstrap-reboot.css',
        "http://yii2.loc/web/css/theme-styles.css",
        "http://yii2.loc/web/css/fonts.css",
        "http://yii2.loc/web/css/blocks.css",
    ];
    public $js = [
      "js/theme-plugins.js",
      "js/material.min.js",
      ""
    ];
    public $depends = [
        'yii\web\YiiAsset',
        'grozzzny\depends\bootstrap4\Bootstrap4Asset',
        'grozzzny\depends\bootstrap4\Bootstrap4PluginAsset',
    ];

    //        'yii\bootstrap\BootstrapAsset',
}

I connect in layout - does not work
use yii\helpers\Html;
use app\assets\ProfileAsset;

ProfileAsset::register($this);

However, with an explicit connection in the code, everything works fine.
Could it be that my styles are being overridden by the bootstrap4 module that I have included, and is it even possible to specify all this explicitly without harming anything?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry, 2019-09-22
@66demon666

Good evening.
Instead
, it is written in the same way as for js
'css/bootstrap-reboot.css'

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question