2017 © Pedro Peláez
 

library nui

nui

image

dragonbuf/nui

nui

  • Friday, June 15, 2018
  • by Dragonbuf
  • Repository
  • 2 Watchers
  • 1 Stars
  • 62 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 55 % Grown

The README.md

备注

yii2 + smarty 通用的后端管理框架。

Usage

composer install dragonbuf/nui

To use this extension, simply add the following code in your application configuration:, (*1)

return [
    //....
    'components' => [
        'view' => [
            'renderers' => [
                'tpl' => [
                    'class' => 'nuiYii\Nui',
                    //'cachePath' => '@runtime/Smarty/cache',
                    'options' => [
                        "left_delimiter" => "%{",
                        'caching' => false,
                        'compile_check' => true,
                    ],
                    'menu' => [
                        [
                            'path' => '/a',
                            'icon' => '',
                            'name' => 'a',
                            'child' => [
                                [
                                    'path' => '/b',
                                    'icon' => '',
                                    'name' => 'b',
                                ],
                                [
                                    'path' => '/c',
                                    'icon' => '',
                                    'name' => 'c',
                                ],
                                [
                                    'path' => '/d',
                                    'icon' => '',
                                    'name' => 'd',
                                ]
                            ]
                        ],
                        [
                            'path' => '/e',
                            'icon' => '',
                            'name' => 'e',
                            'child' => [
                                [
                                    'path' => '/f',
                                    'icon' => '',
                                    'name' => 'f',
                                ],
                            ]
                        ],
                        [
                            'path' => '/signer',
                            'icon' => '',
                            'name' => '个人中心',
                            'child' => [
                            ]
                        ]
                    ],
                    'nuiDefaultName' => 'nui',
                    'userInfo' => '/user-info',//个人中心
                    'setting' => '/setting',//设置
                    'logout' => '/site/logout'//退出
                ],
            ],
    ],
];

SiteController, (*2)

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

index.tpl, (*3)

%{extends "_layout/layout.tpl"}

%{block name="page-title"}main%{/block}

%{block name="page-action"}
    <a href="javascript: void(0);" target="_blank" class="btn btn-danger pull-right m-l-20 hidden-xs hidden-sm waves-effect waves-light">DELETE</a>
    %{/block}





%{block name="main"}

you can begin your view in this

%{/block}

notice

you can set flash message in Controller,nui will show error or success message in flash, (*4)

\Yii::$app->getSession()->setFlash('error', 'This is the message');

\Yii::$app->getSession()->setFlash('success', 'This is the message');

The Versions

15/06 2018

dev-master

9999999-dev

nui

  Sources   Download

The Requires

 

by zhangyanhe

30/05 2018

v1.0.1

1.0.1.0

nui

  Sources   Download

The Requires

 

by zhangyanhe