kriss/yii2-adminlte-iframe-mode
Yii2 AdminLte Iframe Mode
Maintainers
Package info
github.com/krissss/yii2-adminlte-iframe-mode
Type:yii2-extension
pkg:composer/kriss/yii2-adminlte-iframe-mode
v2.0.1
2018-09-10 02:30 UTC
Requires
- php: >=5.6
- dmstr/yii2-adminlte-asset: ^2.5
- yiisoft/yii2: ^2.0.6
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Yii2 AdminLte Iframe Mode
Important
for V2.0。 Not compatible for before !!
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": "^2.0"
to the require section of your composer.json file.
预览
全局全部开启标签页模式
- 增加配置
<?php use kriss\iframeLayout\component\IframeMode; return [ 'components' => [ IframeMode::COMPONENT_NAME => [ 'class' => IframeMode::class, 'enable' => true, 'defaultSwitch' => true, ], ] ];
- 在基础控制器中增加
behavior
<?php use kriss\iframeLayout\filter\IframeLinkFilter; public function behaviors() { $behaviors = parent::behaviors(); $behaviors['iframe_layout'] = [ 'class' => IframeLinkFilter::className(), //'layout' => '@app/views/layouts/main-content', // 使用该参数自定义布局 ]; return $behaviors; }
布局参考: /views/main-content.php
- 在默认的布局文件
(main.php)中增加Asset
<?php \kriss\iframeLayout\widget\IframeModeAssetWidget::widget();
用户动态可更改模式
-
在上面的操作基础上
-
在某个控制器,比如
SiteController中增加action
<?php use kriss\iframeLayout\action\IframeModeSwitchAction; public function actions() { return [ // 其他 actions 'iframe-mode-switch' => [ 'class' => IframeModeSwitchAction::className(), ] ]; }
- 增加切换模式的链接按钮
<?= \kriss\iframeLayout\widget\IframeModeSwitchWidget::widget() ?>
