I'm using My AppAsset Like This Way.
AppAsset.php
<?php
namespace app\assets;
use yii\web\AssetBundle;
class AppAsset extends AssetBundle
{
public $basePath = '@webroot';
public $baseUrl = '@web';
public $css = [
'css/style.css',
];
public $js = [
'js/myscript.js',
];
public $depends = [
'yii\web\YiiAsset',
'yii\bootstrap\BootstrapAsset',
'yii\web\JqueryAsset',
];
}
But, when I press Ctrl + U to see source code,
I get <link href="/css/style.css" rel="stylesheet">. But, no type='text/css'.
How to add type='text/css' for all of my CSS?
relandtypeis 2 different properties for<link>. And, I'm gettingrelby default. Then, why don't I gettypeproperty. Because, few design issues are there. Which HTML developer told me because of not havingtype.typeattribute is optional, and if you omit it and specifyrel=stylesheetthen browsers will default totext/css. Your HTML developer is wrong. Adding a type attribute won't make any difference.$cssOptions = array('type'=>'text/css');.. never used Yii, but it can be found on their Docs:)