kriss/yii2-adminlte-iframe-mode Yii2 AdminLte Iframe Mode

extensionadminlte

Yii2 AdminLte Iframe Mode

Yii2 AdminLte Iframe Mode

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require kriss/yii2-adminlte-iframe-mode -vvv

or add

"kriss/yii2-adminlte-iframe-mode": "*"

to the require section of your composer.json file.

预览

Effect picture 1

全局全部开启标签页模式

  1. 在基础控制器中增加 behavior
public function behaviors()
{
    $behaviors = parent::behaviors();

    $behaviors['iframe_layout'] = [
        'class' => IframeLinkFilter::className(),
        //'layout' => '@app/views/layouts/main-content', // 使用该参数自定义布局
    ];

    return $behaviors;
}

布局参考: /example-views/main-content.php

  1. 在默认的布局文件 (main.php) 中增加 Asset
\kriss\iframeLayout\IframeAsset::register($this);

用户动态可更改模式

  1. 在上面的操作基础上

  2. 在某个控制器,比如 SiteController 中增加 action
public function actions()
{
    return [
        // 其他 actions
        'iframe-mode-change' => [
            'class' => IframeModeChangeAction::className(),
        ]
    ];
}
  1. 增加切换模式的链接按钮
<?= Html::a((IframeModeChangeAction::isIframeMode() ? '关闭' : '开启') . '标签页模式',
    ['/site/iframe-mode-change'], [
        'data-method' => 'post',
        'class' => 'dropdown-menu-item'
    ]) ?>
  1. 修改原 Asset 引入方式
if (IframeModeChangeAction::isIframeMode()) {
    IframeAsset::register($this);
}

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

  • v1.107 February 2018
  • v1.026 December 2017

Comments



v1.1 is the latest of 2 releases



MIT license
Stats
2 github stars & 1 github forks
0 downloads in the last day
6 downloads in the last 30 days
52 total downloads