Giter VIP home page Giter VIP logo

yii2-adminlte-iframe-mode's Introduction

Yii2 AdminLte Iframe Mode

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.

预览

Effect picture 1

全局全部开启标签页模式

  1. 增加配置
<?php
use kriss\iframeLayout\component\IframeMode;

return [
    'components' => [
        IframeMode::COMPONENT_NAME => [
            'class' => IframeMode::class,
            'enable' => true,
            'defaultSwitch' => true,
        ],
    ]
];
  1. 在基础控制器中增加 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

  1. 在默认的布局文件 (main.php) 中增加 Asset
<?php
\kriss\iframeLayout\widget\IframeModeAssetWidget::widget();

用户动态可更改模式

  1. 在上面的操作基础上

  2. 在某个控制器,比如 SiteController 中增加 action

<?php
use kriss\iframeLayout\action\IframeModeSwitchAction;

public function actions()
{
    return [
        // 其他 actions
        'iframe-mode-switch' => [
            'class' => IframeModeSwitchAction::className(),
        ]
    ];
}
  1. 增加切换模式的链接按钮
<?= \kriss\iframeLayout\widget\IframeModeSwitchWidget::widget() ?>

yii2-adminlte-iframe-mode's People

Contributors

krissss avatar amttgroup avatar

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.