kak / panel
Yii2 控面板小部件
1.0.5
2023-05-17 16:16 UTC
Requires
- bower-asset/jquery-slimscroll: *
- yiisoft/yii2: *
- yiisoft/yii2-bootstrap: ^2.0
Requires (Dev)
- codeception/codeception: ^5.0.0 || 4.1.*
- codeception/module-asserts: ^3.0 || ^1.1
- codeception/module-filesystem: ^3.0 || ^1.0
- codeception/module-yii2: ^1.1.4
- phpunit/phpunit: ^9.5
README
这个扩展是为了通过 Bootstrap 3x+ 为 Yii2 框架生成 HTML 控面板
安装
安装此扩展的首选方式是通过 Composer.
运行以下命令之一:
php composer.phar require kak/panel "^1.0"
或者
"kak/panel": "^1.0"
将其添加到你的 composer.json 文件的 require 部分。
使用方法
<?php use kak\widgets\panel\Panel; /** * @var app\models\Post $model * @var yii2\web\View $this */ ?> <?php Panel::begin([ 'title' => ($model->isNewRecord ? 'Create' : ' Update'), // title panel 'slimScroll' => false, // enable slim scroll plugin (default false) 'slimOptions' => [], // slim scroll options for data-attr 'options' => [ 'class' => Panel::CSS_CLASS_WARNING ], // attr tag panel 'heading' => true, // show/hide header title (default true) 'headerColumn' => 'string content', // additional column on the right position for header 'headerIcon' => 'string classes or html tag content', 'headerTag' => 'h4', 'header' => 'header string', 'footer' => 'footer string', 'bodyOptions' => [], // the HTML attributes for the body-panel tag. 'templateHeader' => '<div class="header--title">{title} {header}</div><div class="header--columns">{columns}</div>', ])?> <!-- content --> <?php Panel::end()?>
或者
<?= Panel::widget([ 'title' => 'title panel', 'content' => 'html content' ])?>