Skip to main content

Yii2框架使用adminlte模板方法

1.安装almasaeed2010/adminlte

composer require almasaeed2010/adminlte

2.资源接入

在您所在的app下的assets目录下新建文件AdminLteAsset.php

<?php

namespace app\assets;

use yii\web\AssetBundle;

class AdminLteAsset extends AssetBundle
{
public $sourcePath = '@vendor/almasaeed2010/adminlte/dist';
public $css = [
'css/adminlte.css'
];
public $js = [
'js/adminlte.js'
];
}

3.引用AdminLteAsset

在您所在app下的AppAsset.php中配置

public $depends = [
'yii\web\YiiAsset',
'yii\web\JqueryAsset',
'yii\bootstrap\BootstrapAsset',
'app\assets\AdminLteAsset'
];