yii2.0 后台模板安装 AdminLTE
该项目github地址:https://github.com/dmstr/yii2-adminlte-asset
使用composer安装:
composer require dmstr/yii2-adminlte-asset "2.*"
安装好之后,复制 vendor/dmstr/yii2-adminlte-asset/example-views/yiisoft/yii2-app 到 backend/views/,
需要覆盖的则覆盖,以下为样式效果图
补充:如果想换模板颜色的话可以修改配置文件
1、可以在配置文件中修改 backend/main.php
'components' => [ 'assetManager' => [ 'bundles' => [ 'dmstr\web\AdminLteAsset' => [ 'skin' => 'skin-red', //配置颜色 skin-blue skin-yellow skin-black ], ], ], ],
2、在layouts/main.php中替换代码
<body class="hold-transition skin-blue sidebar-mini">
替换为 <body class="hold-transition <?= \dmstr\helpers\AdminLteHelper::skinClass() ?> sidebar-mini">