2017 © Pedro Peláez
 

yii2-extension yii2-panel

Yii2 Bootstrap Panel

image

derekisbusy/yii2-panel

Yii2 Bootstrap Panel

  • Sunday, November 1, 2015
  • by derekisbusy
  • Repository
  • 1 Watchers
  • 2 Stars
  • 243 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 8 % Grown

The README.md

yii2-panel

Packagist Packagist, (*1)

Collapsable Bootstrap panel widget., (*2)

Installation

The preferred way to install this extension is through composer., (*3)

Either run, (*4)

$ composer require derekisbusy/yii2-panel "dev-master"

or add, (*5)

"derekisbusy/yii2-panel": "dev-master"

to the require section of your composer.json file then run composer update., (*6)

Options

  • title title displayed in the head section of the panel, (*7)

  • content content displayed in the body section of the panel. Only use if using widget() method., (*8)

  • footer content displayed in the footer section of the panel., (*9)

  • type style to be applied to the panel., (*10)

    • info
    • default
    • danger
    • primary
    • success, (*11)

    • collapsable whether the panel is collapsable., (*12)

    • collapse whether or not the panel is collapsed., (*13)

    • widget whether or not to include javascript. Can be used to disable javascript if using as style element only., (*14)

Examples

Basic Example

use derekisbusy\panel\PanelWidget;
echo PanelWidget::widget([
    'collapse'=>true,
    'title'=>'My Panel',
    'content'=>'...',
    'footer'=>'footer content'
    ])
]);

Style Only

If you only need to create HTML for bootstrap panel and don't need any js functionality set widget to false., (*15)

use derekisbusy\panel\PanelWidget;

echo PanelWidget::begin([
    'title'=>'My Panel',
    'widget'=>false, // no js included (ie. style only)
    'footer'=>'footer content'
]);

// the body

PanelWidget::end();

Example with Form Widget

use derekisbusy\panel\PanelWidget;

echo PanelWidget::begin([
    'title'=>$title,
    'widget'=>false,
    'footer'=>Html::submitButton($model->isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary'])
]);

// the form

PanelWidget::end();

The Versions

01/11 2015

dev-master

9999999-dev

Yii2 Bootstrap Panel

  Sources   Download

MIT

The Requires

 

by Derek G

yii2 jquery bootstrap panel extended collapsable