AdminLTE Asset Bundle for Yii2 Framework
This is the AdminLTE extension for Yii framework 2.0. It encapsulates AdminLTE distribution assets and thus makes using AdminLTE in Yii applications extremely easy.
The preferred install way is through Composer:
composer require yidas/yii2-adminlte
Or you could also edit composer.json
with adding package in require section then run composer update
.
"yidas/yii2-adminlte": "~2.1.0"
Register or depend Asset into your application:
yidas\adminlte\AdminlteAsset
For eaxmple, to register AdminLTE assets in view :
\yidas\adminlte\AdminlteAsset::register($this);
Or as dependency in your app asset bundle :
namespace app\assets;
use yii\web\AssetBundle;
class AppAsset extends AssetBundle
{
public $basePath = '@webroot';
public $baseUrl = '@web';
public $css = [
'css/site.css',
];
public $js = [
];
public $depends = [
'yidas\adminlte\AdminlteAsset'
];
}
Configurate asset in config
file:
'components' => [
'assetManager' => [
'bundles' => [
'yidas\adminlte\AdminlteAsset' => [
'skin' => 'skin-black',
],
],
],
],
composer update yidas/yii2-adminlte
composer update almasaeed2010/AdminLTE
composer require almasaeed2010/AdminLTE 2.4.0
This package provides asset bundles of AdminLTE plugins:
Register or depend Asset into your application:
yidas\yii2\adminlte\plugins\iCheckAsset
You could additionally register AdminLTE iCheck assets in view:
\yidas\yii2\adminlte\plugins\iCheckAsset::register($this);
'components' => [
'assetManager' => [
'bundles' => [
'yidas\yii2\adminlte\plugins\iCheckAsset' => [
'skin' => 'flat/aero',
],
],
],
],
Once the extension is installed, you can have a preview by reconfiguring the path mappings of the view component in config:
'components' => [
'view' => [
'theme' => [
'pathMap' => [
'@app/views' => '@vendor/yidas/yii2-adminlte/templates/example'
],
],
],
],
Support both Yii 2 Advanced Application Template or Basic Application Template.
There are several implemented examples of AdminLTE layout for startup.
'@app/views' => '@vendor/yidas/yii2-adminlte/templates/simple'
'@app/views' => '@vendor/yidas/yii2-adminlte/templates/simple_zh-TW'