Tutorial about How to Integrate Yii2 with fantastic theme AdminLTE

You are viewing revision #7 of this wiki article.
This is the latest version of this article.
You may want to see the changes made in this revision.

« previous (#6)

Yii2 comes with a charming twitter bootstrap version 3. But if it is less, then you can integrate with web templates that you like. One example is wonderfull template "adminLTE"

You can use ready-skeleton on GitHub also.

With Yii2 we can do it easily, the following steps

  • Add your composer.json
"bower-asset/admin-lte": "*"
  • Change your AppAsset.php and check to referring it in your views/layouts/main.php
class AppAsset extends AssetBundle
{
    public $sourcePath = '@bower/';
    public $css = ['admin-lte/css/AdminLTE.css'];
    public $js = ['admin-lte/js/AdminLTE/app.js'];
    public $depends = [
        'yii\web\YiiAsset',
        'yii\bootstrap\BootstrapAsset',
        'yii\bootstrap\BootstrapPluginAsset',
    ];
}
  • Change your views adhering to html markup vendor/bower/admin-lte/pages