chervand / yii2-bootstrap
Extension of yiisoft/yii2-bootstrap with additional components.
Installs: 27
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:yii2-extension
Requires
This package is not auto-updated.
Last update: 2024-11-21 01:06:23 UTC
README
Panel
Bootstrap 3 Panel Widget
Usage examples
<?php Panel::begin() ?> <p> Lorem ipsum dolor sit amet, consectetur adipisicing elit. Architecto enim error illo ipsam repellat velit vero. Aliquid at culpa ea nihil non odio odit veritatis vero. A delectus labore provident! </p> <?php Panel::end() ?>
<?= Panel::widget([ 'options' => ['class' => 'panel-primary'], 'heading' => 'Heading', // string 'body' => [ // view file 'view' => '@app/views/site/about', 'params' => ['model' => $model], ], 'footer' => [ // string with options 'options' => ['class' => 'clearfix'], 'content' => \yii\bootstrap\Html::button('Button', ['class' => ' btn btn-primary pull-right']) ] ]) ?>
<?= Panel::widget([ 'options' => ['class' => 'panel-primary'], 'heading' => function () { // closure return 'Heading'; }, 'body' => [ // partial view 'view' => '_body', 'params' => ['model' => $model], ], 'footer' => [ // closure with options 'options' => ['class' => 'clearfix'], 'content' => 'overridden by view', 'view' => function () { return \yii\bootstrap\Html::button('Button', ['class' => ' btn btn-primary pull-right']); } ] ]) ?>
Nav
\chervand\bootstrap\Nav
is an extension of \yii\bootstrap\Nav
widget
which additionally implements collapsible sub navs (alongside with original
widget's dropdowns).
Additional widget attributes
toggle
'collapse' or 'dropdown', defaults to 'dropdown'collapseIdPrefix
sub nav's 'id' prefix, defaults to 'sub-'
Additional items attributes
name
unique item name used for toggling collapses, requireddescription
link 'title'
Usage example
<?= chervand\bootstrap\Nav::widget([ 'toggle' => 'collapse', 'items' => [ [ 'label' => 'Item 1', 'url' => '#', 'name' => 'item1', 'items' => [ [ 'label' => 'Item 1-1', 'url' => '#', 'name' => 'item1-1' ], [ 'label' => 'Item 1-2', 'url' => '#', 'name' => 'item1-2' ] ] ], [ 'label' => 'Item 2', 'url' => '#', 'name' => 'item2' ], ], 'options' => ['class' => 'nav nav-pills nav-stacked'], ]) ?>