PHPackages                             myzero1/yii2-theme-adminlteiframe - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. myzero1/yii2-theme-adminlteiframe

ActiveYii2-module[Utility &amp; Helpers](/categories/utility)

myzero1/yii2-theme-adminlteiframe
=================================

Simple captcha for yii2.Just add the module in config file and use the widget.

1.5.2(1y ago)0259[1 PRs](https://github.com/myzero1/yii2-theme-adminlteiframe/pulls)2BSD-3-ClauseCSS

Since Aug 29Pushed 1y agoCompare

[ Source](https://github.com/myzero1/yii2-theme-adminlteiframe)[ Packagist](https://packagist.org/packages/myzero1/yii2-theme-adminlteiframe)[ RSS](/packages/myzero1-yii2-theme-adminlteiframe/feed)WikiDiscussions master Synced yesterday

READMEChangelog (10)Dependencies (1)Versions (48)Used By (2)

yii2-theme-adminlteiframe
=========================

[](#yii2-theme-adminlteiframe)

It add iframe,based on [almasaeed2010/AdminLTE](https://github.com/almasaeed2010/AdminLTE) and [yiisoft/yii2-gii](https://github.com/yiisoft/yii2-gii)

Show time
---------

[](#show-time)

[![](https://github.com/myzero1/show-time/raw/master/yii2-theme-adminlteiframe/screenshot/801.png)](https://github.com/myzero1/show-time/blob/master/yii2-theme-adminlteiframe/screenshot/801.png)[![](https://github.com/myzero1/show-time/raw/master/yii2-theme-adminlteiframe/screenshot/802.png)](https://github.com/myzero1/show-time/blob/master/yii2-theme-adminlteiframe/screenshot/802.png)[![](https://github.com/myzero1/show-time/raw/master/yii2-theme-adminlteiframe/screenshot/1.png)](https://github.com/myzero1/show-time/blob/master/yii2-theme-adminlteiframe/screenshot/1.png)[![](https://github.com/myzero1/show-time/raw/master/yii2-theme-adminlteiframe/screenshot/2.png)](https://github.com/myzero1/show-time/blob/master/yii2-theme-adminlteiframe/screenshot/2.png)[![](https://github.com/myzero1/show-time/raw/master/yii2-theme-adminlteiframe/screenshot/3.png)](https://github.com/myzero1/show-time/blob/master/yii2-theme-adminlteiframe/screenshot/3.png)[![](https://github.com/myzero1/show-time/raw/master/yii2-theme-adminlteiframe/screenshot/4.png)](https://github.com/myzero1/show-time/blob/master/yii2-theme-adminlteiframe/screenshot/4.png)[![](https://github.com/myzero1/show-time/raw/master/yii2-theme-adminlteiframe/screenshot/5.png)](https://github.com/myzero1/show-time/blob/master/yii2-theme-adminlteiframe/screenshot/5.png)[![](https://github.com/myzero1/show-time/raw/master/yii2-theme-adminlteiframe/screenshot/6.png)](https://github.com/myzero1/show-time/blob/master/yii2-theme-adminlteiframe/screenshot/6.png)[![](https://github.com/myzero1/show-time/raw/master/yii2-theme-adminlteiframe/screenshot/7.png)](https://github.com/myzero1/show-time/blob/master/yii2-theme-adminlteiframe/screenshot/7.png)[![](https://github.com/myzero1/show-time/raw/master/yii2-theme-adminlteiframe/screenshot/8.png)](https://github.com/myzero1/show-time/blob/master/yii2-theme-adminlteiframe/screenshot/8.png)[![](https://github.com/myzero1/show-time/raw/master/yii2-theme-adminlteiframe/screenshot/9.png)](https://github.com/myzero1/show-time/blob/master/yii2-theme-adminlteiframe/screenshot/9.png)[![](https://github.com/myzero1/show-time/raw/master/yii2-theme-adminlteiframe/screenshot/10.png)](https://github.com/myzero1/show-time/blob/master/yii2-theme-adminlteiframe/screenshot/10.png)

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require-dev myzero1/yii2-theme-adminlteiframe：*

```

or add

```
"myzero1/yii2-theme-adminlteiframe": "*"

```

to the require-dev section of your `composer.json` file.

Setting
-------

[](#setting)

Once the extension is installed, simply modify your application configuration as follows:

#### in main.php

[](#in-mainphp)

```
return [
    ......
    // 'defaultRoute' => '/adminlteiframe/layout', // for adminlteiframe theme
    'controllerMap' => [
        // 'adminlteiframe' => [ // for adminlteiframe theme
        //     'class' => 'myzero1\adminlteiframe\controllers\SiteController'
        // ],
        'demo' => [ // for the menu of demo
            'class' => 'myzero1\adminlteiframe\controllers\DemoController'
        ]
    ],
    'components' => [
        ......
        'view' => [
            'theme' => [
                'pathMap' => [
                    '@app/views' => '@vendor/myzero1/yii2-theme-adminlteiframe/src/views/adminlte', // using the adminlte theme
                    // '@app/views' => '@vendor/myzero1/yii2-theme-adminlteiframe/src/views/adminlteiframe', // using the adminlteiframe theme
                ],
            ],
        ],
        'assetManager' => [
            'class' => 'yii\web\AssetManager',
            'forceCopy' => true,// true/false
            /*'bundles'=> [
                'myzero1\adminlteiframe\assets\php\components\LayoutAsset' => [
                    'skin' => 'skin-red',// skin-{blue|black|purple|green|red|yellow}[-light],example skin-blue,skin-blue-light,
                    'menuRefreshTab' => false, // true,false
                    'jsVersion' => '1.7',
                    'cssVersion' => '1.7',
                ], // for adminlteiframe theme
                'myzero1\adminlteiframe\assets\php\components\AdminLteAsset' => [
                    'skin' => 'skin-red',// skin-{blue|black|purple|green|red|yellow}[-light],example skin-blue,skin-blue-light,
                    'jsVersion' => '1.7',
                    'cssVersion' => '1.7',
                ], // for adminlte theme
                'myzero1\adminlteiframe\assets\php\components\MainAsset' => [
                    'showJParticle' => 'true', // 'false'/'true', default 'true',required
                    'loginBg' => 'background:url(/login-bg32-1.jpg) no-repeat center center;background-color:#3c8dbc;background-size:cover;', // path/to/web//login-bg32.jpg
                    'errBg' => 'background:url(/xkbg-1.png) repeat-x center bottom;', // path/to/web//login-bg32.jpg
                    'footer' => '
                        Version 1.0.2
                        Copyright © 2018-2736 &nbsp;
                            myzero1.

                        All rights reserved.
                    ',
                ], // for all theme
            ],*/
        ],
        ......
    ],
    ......
    'params' => [
        ......
        'menu' => [
            [
                'id' => "平台首页",
                'text' => "平台首页",
                'title'=>"平台首页",
                'icon' => "fa fa-dashboard",
                'targetType' => 'iframe-tab',
                'urlType' => 'abosulte',
                'url' => ['/site/index'],
                'isHome' => true,
            ],
            [
                'id' => "level1",
                'text' => "level1",
                'title'=>"level1",
                'icon' => "fa fa-dashboard",
                'targetType' => 'iframe-tab',
                'urlType' => 'abosulte',
                'url' => ['/demo/level1'],
            ],
            [
                'id' => "level2",
                'text' => "level2",
                'title'=>"level2",
                'icon' => "fa fa-laptop",
                'url' => ['#'],
                'children' => [
                    [
                        'id' => "level21",
                        'text' => "level21",
                        'title'=>"level21",
                        'icon' => "fa fa-angle-double-right",
                        'targetType' => 'iframe-tab',
                        'urlType' => 'abosulte',
                        'url' => ['/demo/level21'],
                    ],
                    [
                        'id' => "level22",
                        'text' => "level22",
                        'title'=>"level22",
                        'icon' => "fa fa-angle-double-right",
                        'targetType' => 'iframe-tab',
                        'urlType' => 'abosulte',
                        'url' => ['/demo/level22'],
                    ],
                ],
            ],
        ],
    ],
        ......
    ],
    ......

];
```

#### in main-local.php

[](#in-main-localphp)

```
......
if (YII_ENV_DEV) {
    $config['modules']['gii'] = [
        'class' => 'yii\gii\Module',
        'allowedIPs' => ['127.0.0.1', '::1'],
        'generators' => [
            'adminlteiframe_crud' => [ // generator name
                'class' => 'myzero1\adminlteiframe\gii\templates\crud\Generator', // generator class
                'templates' => [
                    'default' => '@vendor/myzero1/yii2-theme-adminlteiframe/src/gii/templates/crud/adminlteiframe',
                    'z1adminlte' => '@vendor/myzero1/yii2-theme-adminlteiframe/src/gii/templates/crud/adminlte',
                ]
            ],
        ],
    ];
}
......
```

### setting in module

[](#setting-in-module)

in the main.php of module

```
return [
    ......
    'layout' => 'main',// to set theme by setting layout and layoutPath
    'layoutPath' => \Yii::getAlias('@vendor/myzero1/yii2-theme-adminlteiframe/src/views/adminlte/layouts'),
    ......
];
```

Usage
-----

[](#usage)

You can then access home page to watch the theme.

```
http://localhost/path/to/index.php

```

You can then access gii page to watch the crud.

```
http://localhost/path/to/index.php?r=gii
OR
http://localhost/path/to/index.php/gii

```

#### select theme

[](#select-theme)

- `use adminlteifram`

    You show set the layout as layout in site Controller for index page,in `SiteController ` as flowlling, in view:

    ```
    public function actionIndex()
    {
        $this->layout = 'layout';
        return $this->render('index');
    }

    ```

    [![](https://github.com/myzero1/show-time/raw/master/yii2-theme-adminlteiframe/screenshot/1.png)](https://github.com/myzero1/show-time/blob/master/yii2-theme-adminlteiframe/screenshot/1.png)
- `use adminlte`

    You show replace the `render` by `renderAjax` at actionLogin,in `SiteController ` as flowlling, in view:

    ```
    public function actionLogin()
    {
        if (!Yii::$app->user->isGuest) {
            return $this->goHome();
        }

        $model = new LoginForm();
        if ($model->load(Yii::$app->request->post()) && $model->login()) {
            return $this->goBack();
        } else {
            $model->password = '';

            return $this->renderAjax('login', [
                'model' => $model,
            ]);
        }
    }

    ```

    [![](https://github.com/myzero1/show-time/raw/master/yii2-theme-adminlteiframe/screenshot/701.png)](https://github.com/myzero1/show-time/blob/master/yii2-theme-adminlteiframe/screenshot/701.png)

#### use plugins

[](#use-plugins)

- `Add plug-ins to requirements`

    Just add code as flowlling, in view:

    ```

    ```

    `Optional plug-in`

    ```
    \myzero1\adminlteiframe\assets\php\components\plugins\DataRangePickerAsset::register($this);
    \myzero1\adminlteiframe\assets\php\components\plugins\TableAsset::register($this);
    \myzero1\adminlteiframe\assets\php\components\plugins\EchartsAsset::register($this);
    \myzero1\adminlteiframe\assets\php\components\plugins\LayerAsset::register($this);
    \myzero1\adminlteiframe\assets\php\components\plugins\Select2Asset::register($this);
    \myzero1\adminlteiframe\assets\php\components\plugins\SwitchAsset::register($this);
    \myzero1\adminlteiframe\assets\php\components\plugins\Wysihtml5Asset::register($this);
    \myzero1\adminlteiframe\assets\php\components\plugins\ZtreeAsset::register($this);
    ```
- `use echart`

    Just add code as flowlling, in view:

    ```

    ```

    [![](https://github.com/myzero1/show-time/raw/master/yii2-theme-adminlteiframe/screenshot/101.png)](https://github.com/myzero1/show-time/blob/master/yii2-theme-adminlteiframe/screenshot/101.png)
- `use datarangepicker`

    Just add code as flowlling, in view:

    ```

    Or

    ```

    [![](https://github.com/myzero1/show-time/raw/master/yii2-theme-adminlteiframe/screenshot/201.png)](https://github.com/myzero1/show-time/blob/master/yii2-theme-adminlteiframe/screenshot/201.png)
- `use layer`

    Just add code as flowlling, in view:

    ```

    联系方式
