yourickds/adminlte

AdminLTE module for Yii2

Installs: 27

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Type:yii2-extension

1.5.1 2018-11-22 07:40 UTC

This package is auto-updated.

Last update: 2024-06-07 11:56:51 UTC


README

Yii2 module AdminLTE.

Installation

The preferred way to install this extension is through composer.

  • Either run
php composer.phar require --prefer-dist "yourickds/adminlte" "*"

or add

"yourickds/adminlte" : "*"

to the require section of your application's composer.json file.

  • Add a new module in modules section of your application's configuration file, for example:
'modules' => [
    'adminlte' => [
        'class' => 'yourickds\adminlte\Init',
        'layout' => 'main', // main or top
        'layoutBody' => 'fixed', // fixed, layout-boxed or empty
        'toggleSidebar' => false,
        'sidebarExpandHover' => false,
        'toggleRightSidebarSlide' => true,
        // Toggle between dark and light skins for the right sidebar
        'toggleRightSidebarSkin' => 'dark', 
        // skin-blue, skin-black, skin-purple, skin-green, skin-red, skin-yellow,
        // skin-blue-light, skin-black-light, skin-purple-light, skin-green-light,
        // skin-red-light, skin-yellow-light
        'skin' => 'skin-green',
        'dashboard' => 'v2' // v1 or v2
    ]
],
  • Add a authManager in components section of your application's configuration file, for example:
'authManager' => [
    'class' => 'yii\rbac\DbManager',
    'cache' => 'cache'
],
  • Add a new rule for urlManager of your application's configuration file, for example:
'urlManager' => [
    'rules' => [
        'admin/<controller>/<action>' => 'adminlte/<controller>/<action>',
        'admin' => 'adminlte/dashboard',
    ],
],
  • Add a template for Gii CRUD generator of your application's configuration file, for example:
$config['modules']['gii'] = [
    'class' => 'yii\gii\Module',
    'generators' => [
        'crud' => [
            'class' => 'yii\gii\generators\crud\Generator',
            'templates' => [
                'adminlte' => '@vendor/yourickds/adminlte/gii/crud',
            ]
        ]
    ],
    // uncomment the following to add your IP if you are not connecting from localhost.
    // 'allowedIPs' => ['127.0.0.1', '::1'],
];
  • Update the database schema using the migration
php yii migrate/up --migrationPath=@yii/rbac/migrations

and

php yii migrate/up --migrationPath=@vendor/yourickds/adminlte/migrations

Resources