官网地址:https://almsaeedstudio.com/ , 可以预览模板:https://almsaeedstudio.com/themes/AdminLTE/index2.html ,也可以直接下载归档文件 AdminLTE-2.3.7.zip (7.0 MB)。
如果要在yii2项目中安装AdminLTE模板,它实际作为yii2项目的extension,在github上面的项目中有安装说明,地址https://github.com/dmstr/yii2-adminlte-asset。
Installation
The preferred way to install this extension is through composer.
To install AdminLTE v2 run:
php composer.phar require dmstr/yii2-adminlte-asset "2.*"
To install AdminLTE v1 run:
php composer.phar require dmstr/yii2-adminlte-asset "1.*"
Customization
- Copy files from vendor/dmstr/yii2-adminlte-asset/example-views/yiisoft/yii2-app (or other theme) to @app/views.
- Remove the custom view configuration from your application by deleting the path mappings, if you have made them before.
- Edit your views adhering to html markup vendor/almasaeed2010/adminlte/pages
Skins
By default the extension uses blue skin for AdminLTE. You can change it in config file.
'components' => [
'assetManager' => [
'bundles' => [
'dmstr\web\AdminLteAsset' => [
'skin' => 'skin-black',
],
],
],
],
And then just replace class of body skin-blue. You can use AdminLteHelper::skinClass() if you don't want to alter every view file when you change skin color.
<body class="<?= \dmstr\helpers\AdminLteHelper::skinClass() ?>">
自己的总结:
菜单
因为用了admin组件,在AdminLTE中动态获得菜单,可以用如下方法
<?=
dmstr\widgets\Menu::
widget
(
[
'options'
=> [
'class'
=>
'sidebar-menu'
],
'items'
=> \mdm\admin\components\MenuHelper::
getAssignedMenu
(Yii::
$app
->
user
->
id
),
]
)
?>