2017 © Pedro Peláez
 

yii2-extension yii2-bootui

The Bootstrap 3 widget for yii 2 framework.

image

3ch3r46/yii2-bootui

The Bootstrap 3 widget for yii 2 framework.

  • Tuesday, December 16, 2014
  • by 3ch3r46
  • Repository
  • 0 Watchers
  • 0 Stars
  • 352 Installations
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 12 % Grown

The README.md

3ch3r46/yii2-bootui

The Bootstrap 3 widget for yii 2 framework., (*1)

Installation

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

Either run, (*3)

php composer.phar require --prefer-dist 3ch3r46/yii2-bootui "*"

or add, (*4)

"3ch3r46/yii2-bootui": "*"

to the require section of your composer.json file., (*5)

Usage

Once the extension is installed, simply use it in your code by :, (*6)

Form

Example :, (*7)

<?php
$form = bootui\ActiveForm::begin(['type' => 'vertical']);

     echo Html::tag('h1', 'Sign In Form', ['class' => 'page-header']);

     echo $form->field($model, 'username')->textInput()->prepend('Username')->hiddenLabel();

     echo $form->field($model, 'password')->passwordInput()->prepend('Password')->hiddenLabel();

     echo Button::submit('Sign In');

bootui\ActiveForm::end();

Property Field :, (*8)

1. Prepend

Prepend is a Bootstrap feature input group addon. Extend form controls by adding text or buttons before sides of any text-based input. To use this options, follow code below : for text only, (*9)

<?php
$form->field($model, 'attribute')->prepend('Prepend Text');

Prepend for Button, ButtonDropdown, ButtonGroup, ButtonLoading., (*10)

<?php
$form->field($model, 'attribute')->prepend(ClassName, $buttonConfig);

// Button
$form->field($model, 'attribute')->prepend(Button::className(), ['label' => 'Button']);

// ButtonDropdown
$form->field($model, 'attribute')->prepend(ButtonDropdown::className(), [
    'label' => 'Dropdown', 
    'items' => [
        ['label' => 'Index', 'url' => ['index']],
        ['label' => 'About', 'url' => ['about']],
        ['label' => 'Help', 'url' => ['help']],
    ],
]);

// ButtonGroup
$form->field($model, 'attribute')->prepend(ButtonGroup::className(), [
    'buttons' => [
        Button::widget(['label' => 'Index', 'url' => ['index']]),
        Button::widget(['label' => 'About', 'url' => ['about']]),
    ],
]);

// ButtonLoading
$form->field($model, 'attribute')->prepend(ButtonLoading::className(), [
    'loadingText' => 'Button is loading . . .',
    'completeText' => 'Button is complete loading . . .',
    'loadingTimeout' => 5, //second
    'completeTimeout' => 2, //second
]);

2. Append

Append is a Bootstrap feature input group addon. Extend form controls by adding text or buttons after sides of any text-based input. To use this options, follow code below :, (*11)

for text only, (*12)

<?php
$form->field($model, 'attribute')->append('Append Text');

Append for Button, ButtonDropdown, ButtonGroup, ButtonLoading., (*13)

<?php
$form->field($model, 'attribute')->append(ClassName, $buttonConfig);

// Button
$form->field($model, 'attribute')->append(bootui\Button::className(), ['label' => 'Button']);

// ButtonDropdown
$form->field($model, 'attribute')->append(bootui\ButtonDropdown::className(), [
    'label' => 'Dropdown', 
    'items' => [
        ['label' => 'Index', 'url' => ['index']],
        ['label' => 'About', 'url' => ['about']],
        ['label' => 'Help', 'url' => ['help']],
    ],
]);

// ButtonGroup
$form->field($model, 'attribute')->append(bootui\ButtonGroup::className(), [
    'buttons' => [
        Button::widget(['label' => 'Index', 'url' => ['index']]),
        Button::widget(['label' => 'About', 'url' => ['about']]),
    ],
]);

// ButtonLoading
$form->field($model, 'attribute')->append(bootui\ButtonLoading::className(), [
    'loadingText' => 'Button is loading . . .',
    'completeText' => 'Button is complete loading . . .',
    'loadingTimeout' => 5, //second
    'completeTimeout' => 2, //second
]);

3. Size

Size type is a bootstrap feature input option. Create taller or shorter form controls that match button sizes. Size valid value are 'sm' (Small), and 'lg' (Large). To use this options, follow code below :, (*14)

<?php
$form->field($model, 'attribute')->size('sm');

4. Column Wrapper

Column Wrapper form control is a bootstrap grid system. Wrap input and Wrap label in grid columns, or any custom parent element, to easily enforce desired widths. Valid value is a string|array column wrapper valid option value are label and input. Default value for label col-sm-3 and input col-sm-6. To use this options, follow code below :, (*15)

Example in array mode:, (*16)

<?php
$form->field($model, 'attribute')->wrap([
    'label' => 'col-sm-3', 
    'input' => 'col-sm-6',
]);

Example in string mode:, (*17)

<?php
// please look this wrap('label&input') for use the string mode
// Use for label and input
$form->field($model, 'attribute')->wrap('col-sm-3&col-sm-6');

// Use for label only
$form->field($model, 'attribute')->wrap('col-sm-3&');

// Use for input only
$form->field($model, 'attribute')->wrap('&col-sm-6');

5. Hidden Label

Hidden label is an option to hidden a form label. To use this options, follow code below :, (*18)

<?php
$form->field($model, 'attribute')->hiddenLabel();

// OR

$form->field($model, 'attribute')->label(false);

6. Hidden Error

Hidden error is an option to hidden a error reporting default from yii error. To use this options, follow code below :, (*19)

<?php
$form->field($model, 'attribute')->hiddenError();

7. Label To Placeholder

Label to placeholder is an option to generate a placeholder in form control from label. To use this options, follow code below :, (*20)

<?php
$form->field($model, 'attribute')->labelToPlaceholder();

8. Placeholder

Placeholder is an attribute option in default html input element. specifies a short hint that describes the expected valie of an <input> and <textarea> element. To use this options, follow code below :, (*21)

<?php
$form->field($model, 'attribute')->placeholder('placeholder text . . .');

9. No Group

No Group is an option to remove from-group from generator field. To use this options, follow code below :, (*22)

<?php
$form->field($model, 'attribute')->noGroup();

10. Hidden

Hidden is an option to hide a Form Field Label, Form Field Control, Form Field Error, Form Field Hint. To use this options, follow code below :, (*23)

<?php
$form->field($model, 'attribute')->hidden();

11. Label

Label is an option to customize label text. To use this options, follow code below :, (*24)

<?php
// label($value, $options)
$form->field($model, 'attribute')->label('custom label');

12. Read Only

Read Only is a default attribute option from html input element. Specifies that an input field is read-only. Use this to readonly for input, textarea, or dropdownlist and listbox. To use this options, follow code below :, (*25)

<?php
$form->field($model, 'attribute')->readOnly();

13. Disbaled

Disabled is a default attribute option from html input element. specifies that and element should be disabled. Use this to disabled for input, textarea, or dropdownlist and listbox. To use this options, follow code below :, (*26)

<?php
$form->field($model, 'attribute')->disabled();

14. Length (maximum or minimum length)

Length is a default attribute option from html input element (maxlength and minlength). use this to set input length with max or min. max specifies the maximum number of characters allowed an input or textarea element. min specifies the minimum number of characters allowed an input or textarea element. In string mode have two operator prefix. operator minus - is a option for minlength. operator plus + is a options for maxlength. valid value are number or date. To use this options, follow code below :, (*27)

<?php
// in array mode
$form->field($model, 'attribute')->length([
        'max' => '255',
        'min' => '10',
]);

// in string mode
$form->field($model, 'attribute')->length('-10&+255');

15. Inline

Use inline on a series of checkboxes or radios for controls that appear on the same line. Specifies the inline option only for radioList and checkboxList. To use this options, follow code below :, (*28)

<?php
$form->field($model, 'attribute')->checkboxList([
       'first' => 'First List',
       'second' => 'Second List',
       'Third' => 'Third List'
])->inline();

$form->field($model, 'attribute')->radioList([
       'first' => 'First List',
       'second' => 'Second List',
       'Third' => 'Third List'
])->inline();

16. Button

Use button for checkboxList or radioList to grouping look like a button group and style toggling for selected list. Specifies option only for checkboxList and radioList. To use this options, follow code below :, (*29)

<?php
$form->field($model, 'attribute')->checkboxList([
       'first' => 'First List',
       'second' => 'Second List',
       'Third' => 'Third List'
])->button();

$form->field($model, 'attribute')->radioList([
       'first' => 'First List',
       'second' => 'Second List',
       'Third' => 'Third List'
])->button();

17. Button Vertical

Use button for checkboxList or radioList to grouping look like a button group vertical and style toggling for selected list. Specifies option only for checkboxList and radioList. To use this options, follow code below :, (*30)

<?php
$form->field($model, 'attribute')->checkboxList([
       'first' => 'First List',
       'second' => 'Second List',
       'Third' => 'Third List'
])->buttonVertical();

$form->field($model, 'attribute')->radioList([
       'first' => 'First List',
       'second' => 'Second List',
       'Third' => 'Third List'
])->buttonVertical();

18. Template

Template is an option from default field in yii input element. this is function to custom template. To use this options, follow code below :, (*31)

<?php
//in string mode
$form->field($model, 'attribute')->template('{label} {input} {error} {hint}');

//in array mode
$form->field($model, 'attribute')->template(['{input}' => '<div class="well">{input}</div>']); 

Button

Button Widget renderer a bootstrap button., (*32)

Button renderer more buttonType : default, button, submit, buttonInput, and submitInput., (*33)

And have a more type bootstrap button:, (*34)

  • default or bootui\Button::TYPE_DEFAULT is a Standard button., (*35)

  • primary or bootui\Button::TYPE_PRIMARY is a Provides extra visual weight and identifies the primary action in a set of buttons., (*36)

  • success or bootui\Button::TYPE_SUCCESS is an Indicates a successful or positive action., (*37)

  • info or bootui\Button::TYPE_INFO is a Contextual button for informational alert messages., (*38)

  • warning or bootui\Button::TYPE_WARNING is an Indicates caution should be taken with this action., (*39)

  • danger or bootui\Button::TYPE_DANGER is an Indicates a dangerous or potentially negative action., (*40)

  • link or bootui\Button::TYPE_LINK is a Deemphasize a button by making it look like a link while maintaining button behavior., (*41)

Sizing a button in option size have 3 size : xs(Extra Small), sm (Small), and lg (Large). Don't use size option if you use a default size., (*42)

Block a button with option block those that span the full width of a parent., (*43)

Active State Button with option active and valid value are boolean true or false and buttons will appear pressed (with a darker background, darker border, and inset shadow) when active.., (*44)

Disable State with option disable and valid value are boolean true or false and make buttons look unclickable by fading them back 50%., (*45)

Example in button widget default mode:, (*46)

<?php
// default format bootui\Button::widget($config).

// for button mode.

echo bootui\Button::widget([
    'label' => 'Button Action',
    'type' => bootui\Button::TYPE_PRIMARY,
    'buttonType' => 'button',
]);

// for link mode.

echo bootui\Button::widget([
    'label' => 'Button Action',
    'type' => bootui\Button::TYPE_PRIMARY,
    'url' => 'http:://bitbucket.org/3ch3r46',
]);

Example with other mode:, (*47)

link mode in default with array config., (*48)

<?php
echo bootui\Button::link([
    'label' => 'My Home Page Link',
    'url' => 'http:://bitbucket.org/3ch3r46',
    'type' => bootui\Button::TYPE_SUCCESS
]);

link mode in string config., (*49)

<?php
echo bootui\Button::link('label:My Home Page Link;url:bitbucket.org/3ch3r46;type:primary');

or link without key config, only for label in first config and url for second config., (*50)

<?php
echo bootui\Button::link('My Home Page Link;bitbucket.org/3ch3r46;type:primary');

Button Action.

button with array config., (*51)

<?php
echo bootui\Button::button([
    'label' => 'Action',
    'type' => bootui\Button::TYPE_SUCCESS
]);

button in string config., (*52)

<?php
echo bootui\Button::button('label:Action;type:primary');

Submit Button.

submit button with array config., (*53)

<?php
echo bootui\Button::submit([
    'label' => 'Action',
    'type' => bootui\Button::TYPE_INFO
]);

submit button in string config., (*54)

<?php
echo bootui\Button::submit('label:Action;type:primary');

Button Dropdown

Button Dropdown renderer bootstrap dropdown button., (*55)

Config options in button dropdown:, (*56)

  • type is a type of button valid value are default,primary,success,info,warning,danger., (*57)

  • item is a list button dropdown., (*58)

  • size is a sizing button valid value are lg(Large),sm(Small),xs(Extra Small)., (*59)

  • split is a whether to display a group of split-styled button group., (*60)

Example:, (*61)

Single button dropdown., (*62)

<?php
// default
echo bootui\ButtonDropdown::widget([
    'type'=>bootui\Button::TYPE_SUCCESS,
    'label'=>'button dropdown',
    'size'=>'lg',
    'items'=>[
        ['label'=>'bootstrap','url'=>'http://getBootstrap.com'],
        '---',
        'Dropdown Header One',
        ['label' => 'menu one','url'=>'#'],
        ['label' => 'menu two','url'=>'#'],
        ['label' => 'menu three','url'=>'#'],
        'Dropdown Header Two',
        ['label' => 'menu four','url'=>'#'],
        ['label' => 'menu five','url'=>'#']
    ],
]);

// with button object
echo bootui\Button::dropdown([
    'type'=>bootui\Button::TYPE_INFO,
    'label'=>'button dropdown',
    'size'=>'lg',
    'items'=>[
        ['label'=>'bootstrap','url'=>'http://getBootstrap.com'],
        '---',
        'Dropdown Header One',
        ['label' => 'menu one','url'=>'#'],
        ['label' => 'menu two','url'=>'#'],
        ['label' => 'menu three','url'=>'#'],
        'Dropdown Header Two',
        ['label' => 'menu four','url'=>'#'],
        ['label' => 'menu five','url'=>'#']
    ],
]);

Split button dropdown., (*63)

<?php
// default
echo bootui\ButtonDropdown::widget([
    'type'=>'success',
    'label'=>'button dropdown',
    'size'=>'lg',
    'split' => true,
    'items'=>[
        ['label'=>'bootstrap','url'=>'http://getBootstrap.com'],
        '---',
        'Dropdown Header One',
        ['label' => 'menu one','url'=>'#'],
        ['label' => 'menu two','url'=>'#'],
        ['label' => 'menu three','url'=>'#'],
        'Dropdown Header Two',
        ['label' => 'menu four','url'=>'#'],
        ['label' => 'menu five','url'=>'#']
    ],
]);

// with button object
echo bootui\Button::dropdown([
    'type'=>bootui\Button::TYPE_WARNING,
    'label'=>'button dropdown',
    'size'=>'lg',
    'split' => true,
    'items'=>[
        ['label'=>'bootstrap','url'=>'http://getBootstrap.com'],
        '---',
        'Dropdown Header One',
        ['label' => 'menu one','url'=>'#'],
        ['label' => 'menu two','url'=>'#'],
        ['label' => 'menu three','url'=>'#'],
        'Dropdown Header Two',
        ['label' => 'menu four','url'=>'#'],
        ['label' => 'menu five','url'=>'#']
    ],
]);

Button Group

Group a series of buttons together on a single line with the button group., (*64)

Button group have more option :, (*65)

buttons is each array element represents a single button, which can be specified as a string or an array or button object or button dropdown object of the following structure:, (*66)

  • label: string, required, the button label., (*67)

  • options: array, optional, the HTML attributes of the button., (*68)

size is a sizing button have 3 size : xs(Extra Small), sm (Small), and lg (Large). Don't use size option if you use a default size., (*69)

vertical is make a set of buttons appear vertically stacked rather than horizontally., (*70)

justified is make a group of buttons stretch at equal sizes to span the entire width of its parent. Also works with button dropdowns within the button group., (*71)

block is a button those that span the full width of a parent., (*72)

Example:, (*73)

<?php
// default
echo bootui\ButtonGroup::widget([
    'justified'=>true,
    'size' => 'lg',
    'buttons'=>[
        bootui\Button::widget(['label'=>'No One']),
        bootui\Button::widget(['label'=>'No Two']),
        [
            'label'=>'No Three',
            'items' => [
                ['label' => 'dropone'],
                ['label' => 'droptwo'],
            ]
        ]
    ]
]);

// with button object
echo bootui\Button::group([
    'justified'=>true,
    'size' => 'lg',
    'buttons'=>[
        bootui\Button::widget(['label'=>'No One']),
        bootui\Button::widget(['label'=>'No Two']),
        [
            'label'=>'No Three',
            'items' => [
                ['label' => 'dropone'],
                ['label' => 'droptwo'],
            ]
        ]
    ]
]);

Button Loading

Sets button state to loading - disables button and swaps text to loading text. Loading text should be defined on the button element. Config options in button loading:, (*74)

  • loadingText is a text if button is loading., (*75)

  • completeText is a text if button is finish loading., (*76)

  • loadingTimeOut is a time to loading a button in second., (*77)

  • completeTimeOut is a time to complete loading a button in second., (*78)

  • ajaxEvent is a javascript event where button running ajax., (*79)

Loading button with array config., (*80)

<?php
// default
echo bootui\ButtonLoading::widget([
    'loadingText' => 'I am in loading now',
    'completeText' => 'I am complete now',
    'type' => bootui\Button::TYPE_SUCCESS,
    'loadingTimeOut' => 5, // second.
    'completeTimeOut' => 3, // second.
]);

// with button object
echo bootui\Button::loading([
    'loadingText' => 'I am in loading now',
    'completeText' => 'I am complete now',
    'type' => bootui\Button::TYPE_SUCCESS,
    'loadingTimeOut' => 5, // second.
    'completeTimeOut' => 3, // second.
]);

Loading button with string config., (*81)

<?php
echo bootui\Button::loading('loadingText:I am in loading now;completeText:I am complete now;type:primary;loadingTimeOut:5;completeTimeOut:3');

NavBar renderer a bootstrap navigation bar. Navbars are responsive meta components that serve as navigation headers for your application or site. They begin collapsed (and are toggleable) in mobile views and become horizontal as the available viewport width increases., (*82)

Config Options :, (*83)

  • brandLabel is a string the text of the brand., (*84)

  • hiddenBrand set this with array to hidden the brand label where the device width same with class in hidden brand. valid value are sm (hidden on small width), xs (hidden on extra small width), md (hidden on medium width), and lg (hidden on large width)., (*85)

  • brandUrl is array or string the URL for the brand's hyperlink tag. Defaults to site root., (*86)

  • brandOptions is a HTML attributes of the brand link., (*87)

  • padded is bool whether the navbar content should be included in a container div which adds left and right padding. Set this to false for a 100% width navbar., (*88)

  • paddedFluid is bool whether the navbar content should be included in a fluid-container div which adds left and right padding., (*89)

  • type string bootstrap navbar type. see type options., (*90)

  • fixed set navigation bar to fixed in top or bottom. set false to static navigation bar, (*91)

  • items is array list menu item., (*92)

Type bootstrap Options:, (*93)

  • default or bootui\NavBar::TYPE_DEFAULT is a white gray background color., (*94)

  • primary or bootui\NavBar::TYPE_PRIMARY is a blue background color., (*95)

  • success or bootui\NavBar::TYPE_SUCCESS is a green background color., (*96)

  • info or bootui\NavBar::TYPE_INFO is a medium blue background color., (*97)

  • warning or bootui\NavBar::TYPE_WARNING is a yellow background color, (*98)

  • danger or bootui\NavBar::TYPE_DANGER is a red background color., (*99)

  • inverse or bootui\NavBar::TYPE_INVERSE is a black background color., (*100)

Example :, (*101)

<?php
// Normal Mode
bootui\NavBar::begin([
    'brandLabel' => 'My Company',
    'brandUrl' => Yii::$app->homeUrl,
    'type' => bootui\NavBar::TYPE_INFO
]);
echo bootui\Nav::widget([
    'items' => [
        ['label' => 'Home', 'url' => '#'],
        ['label' => 'About', 'url' => '#'],
        ['label' => 'Contact', 'url' => '#'],
        ['label' => 'Profile', 'url' => '#'],
        ['label' => 'Content', 'items' => [
            ['label' => 'News', 'url' => '#'],
            ['label' => 'Pages', 'url' => '#'],
            ['label' => 'Files', 'url' => '#'],
        ]],
    ],
    'isNavbar' => true,
]);
bootui\NavBar::end();

// in widget mode
echo bootui\NavBar::widget([
    'brandLabel' => 'My Company',
    'brandUrl' => Yii::$app->homeUrl,
    'type' => bootui\NavBar::TYPE_INFO,
    'items' => [
    [
        ['label' => 'Home', 'url' => '#'],
        ['label' => 'About', 'url' => '#'],
        ['label' => 'Contact', 'url' => '#'],
        ['label' => 'Profile', 'url' => '#'],
        ['label' => 'Content', 'items' => [
            ['label' => 'News', 'url' => '#'],
            ['label' => 'Pages', 'url' => '#'],
            ['label' => 'Files', 'url' => '#'],
        ]],
    ],
]]);

Nav renderer a bootstrap navigation., (*102)

Config Options:, (*103)

  • items is an array lst of items in the nav widget. see Items Config Options., (*104)

  • activeParent set true if parent of the children item is active and parent will active., (*105)

  • isNavbar set true where this nav is use in navbar. see bootui\NavBar example., (*106)

  • type set this to set the navigation type. valid value are pills or bootui\Nav::TYPE_PILLS and tabs or bootui\Nav::TYPE_TABS., (*107)

  • justified set true to easily make tabs or pills equal widths of their parent at screens wider than 768px. On smaller screens, the nav links are stacked., (*108)

  • stacked set true whether pills or tabs are also vertically stackable., (*109)

  • collapse set true whether navigation are also collapse the dropdown menu., (*110)

Items Config Options:, (*111)

  • label string the nav item label., (*112)

  • url set the absolute url or with array the item's URL. Defaults to "#"., (*113)

  • visible set true than this menu item is visible. Defaults to true., (*114)

  • linkOptions is array HTML attributes of the item's link., (*115)

  • options array the HTML attributes of the item container (LI)., (*116)

  • active set true than the item on active state or false to not active state., (*117)

  • items array or string render a bootstrap dropdown menu., (*118)

Example :, (*119)

<?php
echo bootui\Nav::widget([
    'items' => [
        ['label' => 'Home', 'url' => '#'],
        ['label' => 'About', 'url' => '#'],
        ['label' => 'Contact', 'url' => '#'],
        ['label' => 'Profile', 'url' => '#'],
        ['label' => 'Content', 'items' => [
            ['label' => 'News', 'url' => '#'],
            ['label' => 'Pages', 'url' => '#'],
            ['label' => 'Files', 'url' => '#'],
        ]],
    ],
    'type' => bootui\Nav::TYPE_PILLS,
]);

List Group

ListGroup renderer bootstrap List Group. List groups are a flexible and powerful component for displaying not only simple lists of elements, but complex ones with custom content. The most basic list group is simply an unordered list with list items, and the proper classes, (*120)

Config options this widget:, (*121)

  • items is an array list item. See items option., (*122)

  • type is bootstrap list group type success, info, warning, and danger., (*123)

  • icon is a bootstrap glyphicon and set to all list group item., (*124)

Item Config Options., (*125)

  • label is string or array to render a content in list item. custom content with heading and text., (*126)

  • urlto linkify list group items by using anchor tags instead of list items., (*127)

  • badge to add the badges component to this list group item and it will automatically be positioned on the right., (*128)

  • icon is a bootstrap glyphicon and set to this list group item., (*129)

For Example :, (*130)

<?php
echo bootui\ListGroup::widget([
    'items' => [
        'Morbi leo risus', // in string mode will render a label.
        [
            'icon' => 'globe',
            'label' => 'Porta ac consectetur ac',
            'url' => 'http://brother.com',
            'type' => bootui\ListGroup::TYPE_WARNING,
        ],
        'heading=first Heading,text=Cras justo odio', // will render a label with heading and text.
        'label:heading=Second Heading,text=Dapibus ac facilisis in;url:http://brother.com',
        [
            'label' => [
                'heading' => 'Third Heading',
                'text' => 'Vestibulum at eros'
            ],
            'badge' => 46,
        ]
    ],
    'type' => bootui\ListGroup::TYPE_INFO
]);

Media List

MediaList renderer the bootstrap media list object. Abstract object styles for building various types of components (like blog comments, Tweets, etc) that feature a left- or right-aligned image alongside textual content. The default media allow to float a media object (images, video, audio) to the left or right of a content block., (*131)

Config options this widget:, (*132)

  • items is an array media list item. See items option., (*133)

  • pullImageAll is an alignment of image. valid value are left or right., (*134)

Item config options:, (*135)

  • images to set media image with link to image. image is required., (*136)

  • heading to set the media heading or title of media list item. heading is required., (*137)

  • content to set the media content. content is required., (*138)

  • url use this with absolute url or array url., (*139)

Example :, (*140)

<?php
echo bootui\MediaList::widget([
    'items' => [
        [
            'heading' => 'First Media',
            'content' => 'Text content in here . . .',
            'images' => 'http://www.gravatar.com/avatar/' . md5('3ch3r46@gmail.com') . '?d=identicon'
        ],
        [
            'heading' => 'Second Media',
            'content' => 'Text content in here . . .',
            'images' => 'http://www.gravatar.com/avatar/' . md5('3ch3r46@gmail.com') . '?d=identicon',
            'items' => [
                [
                    'heading' => 'First Sub Media',
                    'content' => 'Text content in here . . .',
                    'images' => 'http://www.gravatar.com/avatar/' . md5('3ch3r46@gmail.com') . '?d=identicon'
                ],
                [
                    'heading' => 'Second Sub Media',
                    'content' => 'Text content in here . . .',
                    'images' => 'http://www.gravatar.com/avatar/' . md5('3ch3r46@gmail.com') . '?d=identicon',
                    'items' => [
                        [
                            'heading' => 'First Sub Media',
                            'content' => 'Text content in here . . .',
                            'images' => 'http://www.gravatar.com/avatar/' . md5('3ch3r46@gmail.com') . '?d=identicon'
                        ],
                    ],
                ],
            ],
        ],
        [
            'heading' => 'Third Media',
            'content' => 'Text content in here . . .',
            'images' => 'http://www.gravatar.com/avatar/' . md5('3ch3r46@gmail.com') . '?d=identicon'
        ]
    ],
]);

Progress Bar

Progress bar renderer bootstrap progress bar., (*141)

Provide up-to-date feedback on the progress of a workflow or action with simple yet flexible progress bars., (*142)

Config Options:, (*143)

  • animate set true to use animation in progress bar., (*144)

  • type the progress bar type. valid value are success, info, warning, danger., (*145)

  • striped set the progress bar is striped or not with boolean(true|false)., (*146)

  • label the progress bar caption., (*147)

  • percent integer the amount of progress as a percentage., (*148)

Example :, (*149)

<?php
echo bootui\Progress::widget([
    'label' => 'Progress bar is running with animation',
    'animate' => true, 
    'percent' => 50, 
    'striped' => true, 
    'type' => bootui\Progress::TYPE_SUCCESS,
]);

The Versions

16/12 2014

dev-master

9999999-dev

The Bootstrap 3 widget for yii 2 framework.

  Sources   Download

MIT

The Requires

 

by Moh Khoirul Anam

css extension yii2 form bootstrap widget button js navigation navbar dropdown