chervand / yii2-bootstrap
Extension of yiisoft/yii2-bootstrap with additional components.
Installs: 27
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:yii2-extension
pkg:composer/chervand/yii2-bootstrap
Requires
This package is not auto-updated.
Last update: 2025-10-23 05:18:51 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'
- collapseIdPrefixsub nav's 'id' prefix, defaults to 'sub-'
Additional items attributes
- nameunique item name used for toggling collapses, required
- descriptionlink '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'], ]) ?>