yii2-adminlte
Implement AdminLTE, (*1)
installation
composer require "sheillendra/yii2-adminlte": "dev-master"
, (*2)
config main.php
components => [
'view' => [
'theme' => [
'pathMap' => [
'@app/views' => [
'@backend/themes/adminlte/views',
'@sheillendra/adminlte/views',
],
'@app/modules' => [
'@backend/themes/adminlte/modules',
'@sheillendra/adminlte/modules',
],
'@app/widgets' => [
'@backend/themes/adminlte/widgets',
'@sheillendra/adminlte/widgets',
]
],
],
],
],
//for to see default view example, uncoment config below
/*
'controllerMap' => [
'admin-lte' => 'sheillendra\adminlte\controllers\AdminLteController'
],
*/
stop here and run your aplication, you can see the default implement of adminlte theme.span/, (*3)
Gii, (*4)
This extension come with gii. Once the extension is installed,
simply modify your application configuration as follows:, (*5)
// /config/main-local.php for yii2-app-advanced
// /config/web.php for yii2-basic
...
if (!YII_ENV_TEST) {
// configuration adjustments for 'dev' environment
...
$config['modules']['gii'] = [
'class'=>'yii\gii\Module',
'generators' =>[
'adminlte-crud' => ['class'=>'sheillendra\adminlte\gii\generators\crud\Generator']
]
];
}
custom
Run CRUD GII
you will get sample code to custom, (*6)
components
grid
change your index view from gii result :, (*7)
title = Yii::t('app', 'Menus Cruds');
$this->params['breadcrumbs'][] = $this->title;
$this->params['selectedSidebar'] = 'menu';
?>