Answer the question
In order to leave comments, you need to log in
Yii2 basic: why is timestamp not added for resources from web folder?
Good afternoon, dear YII experts. Created a set:
class AppAsset extends AssetBundle
{
public $basePath = '@webroot';
public $baseUrl = '@web';
public $css = [
'/css/style.css',
];
public $depends = [
'yii\web\YiiAsset',
'yii\bootstrap\BootstrapPluginAsset',
];
}
'components' => [
'assetManager' => [
'appendTimestamp' => true,
],
]
<link href="/css/style.css" rel="stylesheet">
Answer the question
In order to leave comments, you need to log in
Good afternoon.
Remove the first slash in '/css/style.css',
ps And, as Arik recommends , include the file in the layouts of the application if it is not included.
In main.php
use app\assets\AppAsset;
AppAsset::register($this);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question