Giter Site home page Giter Site logo

yii2-adminlte's Introduction

Notice

This project is out of maintenance.

Recommended use: https://packagist.org/packages/dmstr/yii2-adminlte-asset

Yii2 AdminLTE Asset Bundle

Backend UI for Yii2 Framework, based on AdminLTE v2.x

This package contains an Asset Bundle for Yii 2.0 Framework which registers the CSS files for the AdminLTE user-interface.

AdminLTE template require Font Awesome, so must installed composer plugins asset-plugin.

composer global require "fxp/composer-asset-plugin:~1.0.0"

Installation

The preferred way to install this extension is through composer.

To install AdminLTE v2 run:

composer require wkii/yii2-adminlte

Quick Start

Once the extension is installed, you can have a preview by reconfiguring the path mappings of the view component:

For Yii 2 Application Template or Basic Application Template

'components' => [
    'view' => [
         'theme' => [
             'pathMap' => [
                '@app/views' => '@vendor/wkii/yii2-adminlte/example-views/yii2-app'
             ],
         ],
    ],
],

This asset bundle provides sample files for layout and view (see folder example-views/yii2-app), they are Don't modify in the vendor/ folder.

Therefore it is recommended to copy the views files into your application views folder and adjust them to your needs.

Customization

  • Copy files from vendor/wkii/yii2-adminlte/example-views/yii2-app (or other theme) to @app/views.
  • Remove the custom view configuration from your application by deleting the path mappings, if you have made them before.
  • Edit your views adhering to html markup vendor/almasaeed2010/adminlte/pages

AdminLte Skins

By default the extension uses skin-blue for AdminLTE. You can change it in config file.

'components' => [
    'assetManager' => [
        'bundles' => [
            'Wkii\AdminLTE\Asset\AdminLteAsset' => [
                'skin' => 'skin-red',
            ],
        ],
    ],
],

Here is the list of available skins:

"skin-blue",
"skin-blue-light",
"skin-yellow",
"skin-yellow-light",
"skin-green",
"skin-green-light",
"skin-purple",
"skin-purple-light",
"skin-red",
"skin-red-light",
"skin-black",
"skin-black-light

For Menu

Example menu see main-sidebar.php.

This Widget is extends yii\widgets\Menu. Menu item add icon attribute. use Font Awesome icon. e.g.

['label' => 'Gii', 'url' => ['/gii'], 'icon' =>'fa-gavel']

Layout

Default layout is main.php.
add single single page layout. No sidebar, no control-sidebar, no footer, no content-header, no breadcrumbs. for iframe dialog.

Pjax

pjax templates use yiisoft/jquery-pjax. pjax layout is pjax-main.php. It's include pjax-main-content.php. pjax-content.php output only content of div #pjax-container.

Use pjax, you can change it in config

'layout' => 'pjax-main',
'components' => [
   // ......
]

Or your Controller add attribute

public $layout='pjax-main';

Controller action example:

    public function actionWelcome()
    {
        if (Yii::$app->request->isPjax) {
            $this->layout = 'pjax-content';
            return $this->render('welcome');
        } else {
            return $this->render('welcome');
        }
    }

Further Information

For AdminLTE documentation, please read

For Pjax, please read

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.