I have a module and wanna to create its template.i create assets folder and it’s sub folders and layouts folder in my module and use it in layout :
use app\modules\blog\assets\BlogAsset;
my asset class is below code, after i render my layout of modules ,assets is created in web/assets but it not registered in head of html ?!
<?php
/**
* @link http://www.yiiframework.com/
* @copyright Copyright (c) 2008 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
namespace app\modules\blog\assets;
use yii\web\AssetBundle;
/**
* @author Qiang Xue <qiang.xue@gmail.com>
* @since 2.0
*/
class BlogAsset extends AssetBundle
{
public $sourcePath='@app/modules/blog/assets';
public $css = [
'css/style.css',
];
}
Thank’s for Solutions !