denisok94/yii2-widgets
最新稳定版本:0.0.3
Composer 安装命令:
composer require denisok94/yii2-widgets
包简介
--
关键字:
README 文档
README
Набор виджетов для yii2 на базе yii\bootstrap4\Widget
Installation
composer require --prefer-dist denisok94/yii2-widgets
# or
php composer.phar require --prefer-dist denisok94/yii2-widgets
Use
NavTabs
use denisok94\yii2\widgets\NavTabs; echo NavTabs::widget(['tabs' => [ '1' => [ 'label' => 'label 1', 'content' => 'content text 1', ], '2' => [ 'label' => 'label 2', 'content' => 'content text 2', ], '3' => [ 'label' => 'label 3', 'content' => 'content 3', 'disabled' => true ], //... ]]) echo NavTabs::widget(['tabs' => [ 'overview' => [ 'label' => 'Обзор', 'content' => $this->render('_overview', [ 'model' => $model, ]) ], 'story' => [ 'label' => 'История', 'content' => $this->render('_story', [ 'model' => $model, ]) ], 'outfit' => [ 'label' => 'Одежда', 'content' => $this->render('_outfit', [ 'model' => $model, ]), 'disabled' => true ], ]]);
Box
use denisok94\yii2\widgets\Box; <?php Box::begin([ 'type' => 'primary', // solid / default / primary / success / warning / danger / info 'title' => 'Box title text', 'footer' => 'Box footer text', // or ~ $this->render('_footer', ['model' => $model]) 'collapse' => true, // show button collapse 'remove' => true, // show button remove ]); ?> <!-- box body ↓ --> <blockquote> <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p> <small>Someone famous in <cite title="Source Title">Source Title</cite></small> </blockquote> <?php Box::end(); ?>
BlokFiles
Базовая горизонтальная группировка (тест)
use denisok94\yii2\widgets\BlokFiles; echo BlokFiles::widget([ 'items' => $items, 'options' => [ 'a' => [], // or 'div' => [], 'img' => [], 'span' => []] ]);
options a/img:
$options = [ 'url' => '/app/', 'key' => 'id', // items->id ]; // url + key $options = [ 'url' => '/app/${key}.png', 'key' => 'id', // items->id 'parse' => true, ]; // url/key.png
options span: ['key' => 'id', // items->id].
base yii html options add ['options' => []].
use denisok94\yii2\widgets\BlokFiles; echo BlokFiles::widget([ 'items' => $items, 'callback' => function ($action, $item, $key) { return $action = 'img' ? 'url1' : 'url2'; }, ]);
location full
use denisok94\yii2\widgets\BlokFiles; echo BlokFiles::widget([ 'items' => $items, 'options' => [ 'a' => [ 'url' => '/app/', 'key' => 'id', // items->id ], 'img' => [ 'url' => '/app/${key}.png', 'key' => 'id', // items->id 'parse' => true, ], 'span' => [ 'key' => 'name', // items->name ], ] ]);
统计信息
- 总下载量: 3
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2025-03-08


