0

I am using yii2 basic application template. How to configure, install and have working admin lte?

Questions
  • 69
  • 1
  • 12

1 Answers1

0

Method 1

1) Go to https://github.com/almasaeed2010/AdminLTE/releases and download last version.

2) Create folder bower in vendor path. And in bower create new folder admin-lte again.

3) Extract archive from first step to /vendor/bower/admin-lte.

4) Change your AppAsset (it is location in app/assets folder) and add this code:

class AppAsset extends AssetBundle
{
   public $sourcePath = '@bower/';
   public $css = ['admin-lte/dist/css/AdminLTE.css'];
   public $js = ['admin-lte/dist/js/AdminLTE/app.js'];
   public $depends = [
       'yii\web\YiiAsset',
       'yii\bootstrap\BootstrapAsset',
       'yii\bootstrap\BootstrapPluginAsset',
   ];
}

Method 2

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.*"

Add below lines in your config/web.php inside the components array. It will diplay example views. Change the path accordingly

'components' => [
    'view' => [
        'theme' => [
            'pathMap' => [
                '@app/views' => '@vendor/dmstr/yii2-adminlte-asset/example-views/yiisoft/yii2-app'
            ],
         ], 
    ],
],
Insane Skull
  • 9,220
  • 9
  • 44
  • 63