Skip to content

yidas/yii2-adminlte

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
img
 
 
src
 
 
 
 
 
 
 
 

AdminLTE Extension for Yii 2


AdminLTE Asset Bundle for Yii2 Framework

Latest Stable Version License Total Downloads Monthly Downloads

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.


DEMONSTRATION


INSTALLATION

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"

CONFIGURATION

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'
    ];
}

CUSTOMIZATION

Skin

Configurate asset in config file:

'components' => [
    'assetManager' => [
        'bundles' => [
            'yidas\adminlte\AdminlteAsset' => [
                'skin' => 'skin-black',
            ],
        ],
    ],
],

USAGE

Version Control

Update dependent packages

composer update yidas/yii2-adminlte

Update newest AdminLTE version

composer update almasaeed2010/AdminLTE

Specify a AdminLTE version

composer require almasaeed2010/AdminLTE 2.4.0

PLUGINS

This package provides asset bundles of AdminLTE plugins:

iCheck

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);

Skin

'components' => [
    'assetManager' => [
        'bundles' => [
            'yidas\yii2\adminlte\plugins\iCheckAsset' => [
                'skin' => 'flat/aero',
            ],
        ],
    ],
],

TEMPLATES

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.

Example Templates

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'