hail812/yii2-adminlte3 adminlte3 for yii2

hail812/yii2-adminlte3

  1. Installation
  2. Usage
  3. AdminLTE Plugins

adminlte3 for yii2

home

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist hail812/yii2-adminlte3 "*"

or add

"hail812/yii2-adminlte3": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, you can config the path mappings of the view component:

'components' => [
    'view' => [
         'theme' => [
             'pathMap' => [
                '@app/views' => '@vendor/hail812/yii2-adminlte3/src/views'
             ],
         ],
    ],
],

Copy files from @vendor/hail812/yii2-adminlte3/src/views to @app/views, then edit.

simply use:

<?= \hail812\adminlte3\widgets\Alert::widget([
    'type' => 'success',
    'body' => '<h3>Congratulations!</h3>'
]) ?>

AdminLTE Plugins

AdminLTE Plugins are not included in AdminLteAsset, if you want to use any of them you can add it dynamically with PluginAsset. For example:

/* @var $this \yii\web\View */

\hail812\adminlte3\assets\PluginAsset::register($this)->add('sweetalert2');

before this, maybe you should edit params.php:

return [
    'adminEmail' => 'admin@example.com',
    'hail812/yii2-adminlte3' => [
        'pluginMap' => [
            'sweetalert2' => [
                'css' => 'sweetalert2-theme-bootstrap-4/bootstrap-4.min.css',
                'js' => 'sweetalert2/sweetalert2.min.js'
            ]
        ]
    ]
];

or

/* @var $this \yii\web\View */

$bundle = \hail812\adminlte3\assets\PluginAsset::register($this);
$bundle->css[] = 'sweetalert2-theme-bootstrap-4/bootstrap-4.min.css';
$bundle->js[] = 'sweetalert2/sweetalert2.min.js';
1 0
2 followers
802 downloads
Yii Version: 2.0
License: BSD-4-Clause
Category: User Interface
Developed by: hail
Created on: Apr 25, 2020
Last updated: 3 months ago
Packagist Profile
Github Repository

Related Extensions