PHP Class kartik\helpers\Html

See also: http://getbootstrap.com/css
See also: http://getbootstrap.com/components
Since: 2.0
Author: Kartik Visweswaran ([email protected])
Inheritance: extends yii\helpers\Html
Datei anzeigen Open project: kartik-v/yii2-helpers Class Usage Examples

Public Methods

Method Description
abbr ( string $content, string $title, boolean $initialism = false, array $options = [] ) : string Generates a bootstrap abbreviation.
activeCheckboxButtonGroup ( Model $model, string $attribute, array $items, array $options = [] ) : string Generates an active bootstrap checkbox button group. A checkbox button group allows multiple selection, like [[listBox()]]. As a result, the corresponding submitted value is an array. The selection of the checkbox button group is taken from the value of the model attribute.
activeRadioButtonGroup ( Model $model, string $attribute, array $items, array $options = [] ) : string Generates an active bootstrap radio button group. A radio button group is like a checkbox button group, except that it only allows single selection. The selection of the radio buttons is taken from the value of the model attribute.
address ( string $name, array $lines = [], array $phone = [], array $email = [], array $options = [], string $phoneLabel = '(P)', string $emailLabel = '(E)' ) : string Generates a bootstrap address block.
badge ( string $content, array $options = [], string $tag = 'span' ) : string Generates a badge.
blockquote ( string $content, string $citeContent = '', string $citeTitle = '', string $citeSource = '', array $options = [] ) : string Generates a bootstrap blockquote.
bsLabel ( string $content, string $type = 'default', array $options = [], string $prefix = 'label label-', string $tag = 'span' ) : string Generates a bootstrap label markup.
caret ( string $direction = 'down', boolean $disabled = false, array $options = [], string $tag = 'span' ) : string Generates a bootstrap caret.
checkboxButtonGroup ( string $name, string | array $selection = null, array $items = [], array $options = [] ) : string Generates a bootstrap checkbox button group. A checkbox button group allows multiple selection, like [[listBox()]]. As a result, the corresponding submitted value is an array.
closeButton ( string $label = '×', array $options = [], string $tag = 'button' ) : string Generates a generic bootstrap close icon button for dismissing content like modals and alerts.
getButtonGroup ( string $type, string $name, string | array $selection = null, array $items = [], array $options = [] ) : string Generates a bootstrap toggle button group (checkbox or radio type)
icon ( string $icon, array $options = [], string $prefix = 'glyphicon glyphicon-', string $tag = 'span' ) : string Generates a bootstrap icon markup.
jumbotron ( string | array $content = [], boolean $fullWidth = false, array $options = [] ) : string Generates a jumbotron - a lightweight, flexible component that can optionally extend the entire viewport to showcase key content on your site.
listGroup ( array $items = [], array $options = [], string $tag = 'div', string $itemTag = 'div' ) : string Generates a list group. Flexible and powerful component for displaying not only simple lists of elements, but complex ones with custom content.
media ( string $heading = '', string $body = '', string | array $src = '', string | array $img = '', array $srcOptions = [], array $imgOptions = [], array $headingOptions = [], array $bodyOptions = [], array $options = [], string $tag = 'div' ) : string Generates a bootstrap media object. Abstract object styles for building various types of components (like blog comments, Tweets, etc) that feature a left-aligned or right-aligned image alongside textual content.
mediaList ( array $items = [], array $options = [] ) : string Generates bootstrap list of media (useful for comment threads or articles lists).
pageHeader ( string $title, string $subTitle = '', array $options = [] ) : string Generates a page header.
panel ( array $content = [], string $type = 'default', array $options = [], string $prefix = 'panel panel-' ) : string Generates a panel for boxing content.
radioButtonGroup ( string $name, string | array $selection = null, array $items = [], array $options = [] ) : string Generates a bootstrap radio button group. A radio button group is like a checkbox button group, except that it only allows single selection.
well ( string $content, string $size = '', array $options = [] ) : string Generates a well container.

Protected Methods

Method Description
getListGroupItem ( array $item, string $tag ) : string Processes and generates each list group item
getMediaItem ( array $item = [], string $tag = 'div' ) : string Processes and generates each media item
getMediaList ( array $items, boolean $top = true ) : string Processes media items array to generate a recursive list.
getPanelContent ( array $content, string $type ) : string Generates panel content
getPanelTitle ( array $content, string $type ) : string Generates panel title for heading and footer.

Method Details

abbr() public static method

Example: ~~~ echo Html::abbr('HTML', 'HyperText Markup Language') . ' is the best thing since sliced bread'; echo Html::abbr('HTML', 'HyperText Markup Language', true); ~~~
See also: http://getbootstrap.com/css/#type-abbreviations
public static abbr ( string $content, string $title, boolean $initialism = false, array $options = [] ) : string
$content string the abbreviation content
$title string the abbreviation title
$initialism boolean if set to true, will display a slightly smaller font-size.
$options array html options for the abbreviation
return string

activeCheckboxButtonGroup() public static method

Example: ~~~ echo Html::activeCheckboxButtonGroup($model, 'attr', [1 => 'Check 1', 2 => 'Check 2', 3 => 'Check 3']); ~~~
See also: http://getbootstrap.com/javascript/#buttons-checkbox-radio
public static activeCheckboxButtonGroup ( Model $model, string $attribute, array $items, array $options = [] ) : string
$model yii\base\Model the model object
$attribute string the attribute name or expression. See [[getAttributeName()]] for the format about attribute expression.
$items array the data item used to generate the checkboxes. The array keys are the checkbox values, and the array values are the corresponding labels. Note that the labels will NOT be HTML-encoded, while the values will.
$options array options (name => config) for the checkbox list container tag. The following options are specially handled: - `tag`: _string_, the tag name of the container element. - `unselect`: _string_, the value that should be submitted when none of the checkboxes is selected. You may set this option to be null to prevent default value submission. If this option is not set, an empty string will be submitted. - `encode`: _boolean_, whether to HTML-encode the checkbox labels. Defaults to `true`. This option is ignored if `item` option is set. - `separator`: _string_, the HTML code that separates items. - `itemOptions`: _array_, the options for generating the checkbox tag using [[checkbox()]]. - `item`: _Closure_, a callback that can be used to customize the generation of the HTML code corresponding to a single item in $items. The signature of this callback must be: ~~~ function ($index, $label, $name, $checked, $value) ~~~ where `$index` is the zero-based index of the checkbox in the whole list; `$label` is the label for the checkbox; and `$name`, `$value` and `$checked` represent the name, value and the checked status of the checkbox input. See [[renderTagAttributes()]] for details on how attributes are being rendered.
return string the generated bootstrap checkbox button group

activeRadioButtonGroup() public static method

Example: ~~~ echo Html::activeRadioButtonGroup($model, 'attr', [1 => 'Option 1', 2 => 'Option 2', 3 => 'Option 3']); ~~~
See also: http://getbootstrap.com/javascript/#buttons-checkbox-radio
public static activeRadioButtonGroup ( Model $model, string $attribute, array $items, array $options = [] ) : string
$model yii\base\Model the model object
$attribute string the attribute name or expression. See [[getAttributeName()]] for the format about attribute expression.
$items array the data item used to generate the radio buttons. The array keys are the radio values, and the array values are the corresponding labels. Note that the labels will NOT be HTML-encoded, while the values will.
$options array options (name => config) for the radio button list container tag. The following options are specially handled: - `tag`: _string_, the tag name of the container element. - `unselect`: _string_, the value that should be submitted when none of the radio buttons is selected. By setting this option, a hidden input will be generated. - `encode`: boolean, whether to HTML-encode the radio button labels. Defaults to `true`. This option is ignored if `item` option is set. - `separator`: _string_, the HTML code that separates items. - `itemOptions`: _array_, the options for generating the radio button tag using [[radio()]]. - `item`: _Closure_, a callback that can be used to customize the generation of the HTML code corresponding to a single item in $items. The signature of this callback must be: ~~~ function ($index, $label, $name, $checked, $value) ~~~ where `$index` is the zero-based index of the radio button in the whole list; `$label` is the label for the radio button; and `$name`, `$value` and `$checked` represent the name, value and the checked status of the radio button input. See [[renderTagAttributes()]] for details on how attributes are being rendered.
return string the generated bootstrap radio button group

address() public static method

Example: ~~~ echo Html::address( 'Twitter, Inc.', ['795 Folsom Ave, Suite 600', 'San Francisco, CA 94107'], ['Res' => '(123) 456-7890', 'Off'=> '(456) 789-0123'], ['Res' => '[email protected]', 'Off' => '[email protected]'] ); $address = Html::address( 'Twitter, Inc.', ['795 Folsom Ave, Suite 600', 'San Francisco, CA 94107'], ['Res' => '(123) 456-7890', 'Off'=> '(456) 789-0123'], ['Res' => '[email protected]', 'Off' => '[email protected]'], Html::icon('phone'), Html::icon('envelope') ); echo Html::well($address, Html::SIZE_TINY); ~~~
See also: http://getbootstrap.com/css/#type-addresses
public static address ( string $name, array $lines = [], array $phone = [], array $email = [], array $options = [], string $phoneLabel = '(P)', string $emailLabel = '(E)' ) : string
$name string the addressee name.
$lines array the lines of address information.
$phone array the list of phone numbers - passed as $key => $value, where: - `$key`: _string_, is the phone type could be 'Res', 'Off', 'Cell', 'Fax'. - `$value`: _string_, is the phone number.
$email array the list of email addresses - passed as $key => $value, where: - `$key`: _string_, is the email type could be 'Res', 'Off'. - `$value`: _string_, is the email address.
$options array html options for the address.
$phoneLabel string the prefix label for each phone - defaults to '(P)'.
$emailLabel string the prefix label for each email - defaults to '(E)'.
return string

badge() public static method

Example: ~~~ echo Html::badge('10'); echo Html::badge('20', ['font-size' => '16px']); ~~~
See also: http://getbootstrap.com/components/#badges
public static badge ( string $content, array $options = [], string $tag = 'span' ) : string
$content string the badge content
$options array HTML attributes / options for the label container
$tag string the label container tag. Defaults to 'span'.
return string

blockquote() public static method

Example: ~~~ echo Html::blockquote( 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.', 'Someone famous in {source}', 'International Premier League', 'IPL' ); ~~~
See also: http://getbootstrap.com/css/#type-blockquotes
public static blockquote ( string $content, string $citeContent = '', string $citeTitle = '', string $citeSource = '', array $options = [] ) : string
$content string the blockquote content
$citeContent string the content of the citation (optional) - this should typically include the tag '{source}' to embed the cite source
$citeTitle string the cite source title (optional)
$citeSource string the cite source (optional)
$options array html options for the blockquote
return string

bsLabel() public static method

Example: ~~~ echo Html::bsLabel('Draft'); echo Html::bsLabel('Inactive', 'danger'); echo Html::bsLabel('Active', 'success'); ~~~
See also: http://getbootstrap.com/components/#labels
public static bsLabel ( string $content, string $type = 'default', array $options = [], string $prefix = 'label label-', string $tag = 'span' ) : string
$content string the label content
$type string the bootstrap label type. Defaults to 'default'. Should be one of the bootstrap contextual colors: 'default, 'primary', 'success', 'info', 'danger', 'warning'.
$options array HTML attributes / options for the label container
$prefix string the CSS class prefix. Defaults to 'label label-'.
$tag string the label container tag. Defaults to 'span'.
return string

caret() public static method

Example: ~~~ echo 'Down Caret ' . Html::caret(); echo 'Up Caret ' . Html::caret('up'); echo 'Disabled Caret ' . Html::caret('down', true); ~~~
See also: http://getbootstrap.com/css/#helper-classes-carets
public static caret ( string $direction = 'down', boolean $disabled = false, array $options = [], string $tag = 'span' ) : string
$direction string whether to display as 'up' or 'down' direction. Defaults to `down`.
$disabled boolean if the caret is to be displayed as disabled. Defaults to `false`.
$options array html options for the caret container.
$tag string the html tag for rendering the caret. Defaults to `span`.
return string

checkboxButtonGroup() public static method

Example: ~~~ echo Html::checkboxButtonGroup('cbx', [1, 2], [1 => 'Check 1', 2 => 'Check 2', 3 => 'Check 3']); ~~~
See also: http://getbootstrap.com/javascript/#buttons-checkbox-radio
public static checkboxButtonGroup ( string $name, string | array $selection = null, array $items = [], array $options = [] ) : string
$name string the name attribute of each checkbox.
$selection string | array the selected value(s).
$items array the data item used to generate the checkboxes. The array keys are the checkbox values, while the array values are the corresponding labels.
$options array options (name => config) for the checkbox list container tag. The following options are specially handled: - `tag`: _string_, the tag name of the container element. - `unselect`: _string_, the value that should be submitted when none of the checkboxes is selected. You may set this option to be null to prevent default value submission. If this option is not set, an empty string will be submitted. - `encode`: _boolean_, whether to HTML-encode the checkbox labels. Defaults to `true`. This option is ignored if `item` option is set. - `separator`: _string_, the HTML code that separates items. - `itemOptions`: _array_, the options for generating the checkbox tag using [[checkbox()]]. - `item`: _Closure_, a callback that can be used to customize the generation of the HTML code corresponding to a single item in $items. The signature of this callback must be: ~~~ function ($index, $label, $name, $checked, $value) ~~~ where `$index` is the zero-based index of the checkbox in the whole list; `$label` is the label for the checkbox; and `$name`, `$value` and `$checked` represent the name, value and the checked status of the checkbox input. See [[renderTagAttributes()]] for details on how attributes are being rendered.
return string the generated checkbox button group

closeButton() public static method

Example: ~~~ echo Html::closeButton(); echo Html::closeButton(Html::icon('remove-sign'); ~~~
See also: http://getbootstrap.com/css/#helper-classes-close
public static closeButton ( string $label = '×', array $options = [], string $tag = 'button' ) : string
$label string the close icon label. Defaults to `×`.
$options array HTML attributes / options for the close icon button.
$tag string the HTML tag for rendering the close icon. Defaults to `button`.
return string

getButtonGroup() public static method

Generates a bootstrap toggle button group (checkbox or radio type)
See also: http://getbootstrap.com/javascript/#buttons-checkbox-radio
public static getButtonGroup ( string $type, string $name, string | array $selection = null, array $items = [], array $options = [] ) : string
$type string whether checkbox or radio.
$name string the name attribute of each checkbox.
$selection string | array the selected value(s).
$items array the data item used to generate the checkboxes/radios. The array keys are the checkbox/radio values, while the array values are the corresponding labels.
$options array options (name => config) for the checkbox/radio list container tag. The following options are specially handled: - `tag`: _string_, the tag name of the container element. - `unselect`: _string_, the value that should be submitted when none of the checkboxes/radios is selected. By setting this option, a hidden input will be generated. - `encode`: boolean, whether to HTML-encode the checkbox/radio labels. Defaults to `true`. This option is ignored if `item` option is set. - `separator`: _string_, the HTML code that separates items. - `itemOptions`: _array_, the options for generating the checkbox/radio tag using [[checkbox()]]/[[radio()]]. - `item`: _Closure_, a callback that can be used to customize the generation of the HTML code corresponding to a single item in $items. The signature of this callback must be: ~~~ function ($index, $label, $name, $checked, $value) ~~~ where `$index` is the zero-based index of the checkbox/radio in the whole list; `$label` is the label for the checkbox/radio; and `$name`, `$value` and `$checked` represent the name, value and the checked status of the checkbox/radio input, respectively. See [[renderTagAttributes()]] for details on how attributes are being rendered.
return string the generated toggle button group

getListGroupItem() protected static method

Processes and generates each list group item
protected static getListGroupItem ( array $item, string $tag ) : string
$item array the list item configuration. The following array key properties can be setup: - `content`: _string_|_array_, the list item content. When passed as a string, it will display this directly as a raw content. When passed as an array, it requires these keys: - `heading`: _string_, the content heading (optional). - `body`: _string_, the content body (optional). - `headingOptions`: _array_, the HTML attributes / options for heading container (optional). - `bodyOptions`: _array_, the HTML attributes / options for body container (optional). - `url`: string|array, the url for linking the list item content (optional). - `badge`: _string_, any badge content to be displayed for this list item (optional) - `badgeOptions`: _array_, the HTML attributes / options for badge container (optional). - `active`: _boolean_, to highlight the item as active (applicable only if $url is passed). Defaults to `false`. - `options`: _array_, HTML attributes / options for the list group item container (optional).
$tag string the list item container tag (applied if it is not a link)
return string

getMediaItem() protected static method

Processes and generates each media item
protected static getMediaItem ( array $item = [], string $tag = 'div' ) : string
$item array the media item configuration
$tag string the media item container tag
return string

getMediaList() protected static method

Processes media items array to generate a recursive list.
protected static getMediaList ( array $items, boolean $top = true ) : string
$items array the media items
$top boolean whether item is the topmost parent
return string

getPanelContent() protected static method

Generates panel content
protected static getPanelContent ( array $content, string $type ) : string
$content array the panel content components.
$type string one of the content settings
return string

getPanelTitle() protected static method

Generates panel title for heading and footer.
protected static getPanelTitle ( array $content, string $type ) : string
$content array the panel content settings.
$type string whether `heading` or `footer`
return string

icon() public static method

Example: ~~~ echo Html::icon('pencil'); echo Html::icon('trash', ['style' => 'color: red; font-size: 2em']); echo Html::icon('plus', ['class' => 'text-success']); ~~~
See also: http://getbootstrap.com/components/#glyphicons
public static icon ( string $icon, array $options = [], string $prefix = 'glyphicon glyphicon-', string $tag = 'span' ) : string
$icon string the bootstrap icon name without prefix (e.g. 'plus', 'pencil', 'trash')
$options array HTML attributes / options for the icon container
$prefix string the css class prefix - defaults to 'glyphicon glyphicon-'
$tag string the icon container tag (usually 'span' or 'i') - defaults to 'span'
return string

jumbotron() public static method

Example: ~~~ echo Html::jumbotron( '

Hello, world

This is a simple jumbotron-style component for calling extra attention to featured content or information.

' ); echo Html::jumbotron([ 'heading' => 'Hello, world!', 'body' => 'This is a simple jumbotron-style component for calling extra attention to featured content or information.' ]); echo Html::jumbotron([ 'heading' => 'Hello, world!', 'body' => 'This is a simple jumbotron-style component for calling extra attention to featured content or information.' 'buttons' => [ [ 'label' => 'Learn More', 'icon' => 'book', 'url' => '#', 'type' => Html::TYPE_PRIMARY, 'size' => Html::LARGE ], [ 'label' => 'Contact Us', 'icon' => 'phone', 'url' => '#', 'type' => Html::TYPE_DANGER, 'size' => Html::LARGE ] ] ]); ~~~
See also: http://getbootstrap.com/components/#jumbotron
public static jumbotron ( string | array $content = [], boolean $fullWidth = false, array $options = [] ) : string
$content string | array the list item content. When passed as a string, it will display this directly as a raw content. When passed as an array, it requires these keys: - `heading`: _string_, the jumbotron heading title - `body`: _string_, the jumbotron content body - `buttons`: _array_, the configuration for jumbotron buttons. The following properties can be set: - `label`: _string_, the button label - `icon`: _string_, the icon to place before the label - `url`: mixed, the button url - `type`: _string_, one of the bootstrap color modifier constants. Defaults to [[TYPE_DEFAULT]]. - `size`: _string_, one of the size modifier constants - `options`: _array_, the HTML attributes / options for the button.
$fullWidth boolean whether this is a full width jumbotron without any corners. Defaults to `false`.
$options array HTML attributes / options for the jumbotron container.
return string

listGroup() public static method

Example: ~~~ echo Html::listGroup([ [ 'content' => 'Cras justo odio', 'url' => '#', 'badge' => '14', 'active' => true ], [ 'content' => 'Dapibus ac facilisis in', 'url' => '#', 'badge' => '2' ], [ 'content' => 'Morbi leo risus', 'url' => '#', 'badge' => '1' ], ]); echo Html::listGroup([ [ 'content' => ['heading' => 'Heading 1', 'body' => 'Cras justo odio'], 'url' => '#', 'badge' => '14', 'active' => true ], [ 'content' => ['heading' => 'Heading 2', 'body' => 'Dapibus ac facilisis in'], 'url' => '#', 'badge' => '2' ], [ 'content' => ['heading' => 'Heading 2', 'body' => 'Morbi leo risus'], 'url' => '#', 'badge' => '1' ], ]); ~~~
See also: http://getbootstrap.com/components/#list-group
public static listGroup ( array $items = [], array $options = [], string $tag = 'div', string $itemTag = 'div' ) : string
$items array the list group items. The following array key properties can be setup: - `content`: mixed, the list item content. When passed as a string, it will display this directly as a raw content. When passed as an array, it requires these keys - `heading`: _string_, the content heading (optional). - `headingOptions`: _array_, the HTML attributes / options for heading container (optional). - `body`: _string_, the content body (optional). - `bodyOptions`: _array_, the HTML attributes / options for body container (optional). - `url`: _string_|_array_, the url for linking the list item content (optional). - `badge`: _string_, any badge content to be displayed for this list item (optional) - `badgeOptions`: _array_, the HTML attributes / options for badge container (optional). - `active`: _boolean_, to highlight the item as active (applicable only if $url is passed). Defaults to `false`. - `options`: _array_, HTML attributes / options for the list group item container (optional).
$options array HTML attributes / options for the list group container
$tag string the list group container tag. Defaults to 'div'.
$itemTag string the list item container tag. Defaults to 'div'.
return string

media() public static method

Example: ~~~ echo Html::media( 'Media heading 1', 'Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo.', '#', 'http://placehold.it/64x64' ); ~~~
See also: http://getbootstrap.com/components/#media
public static media ( string $heading = '', string $body = '', string | array $src = '', string | array $img = '', array $srcOptions = [], array $imgOptions = [], array $headingOptions = [], array $bodyOptions = [], array $options = [], string $tag = 'div' ) : string
$heading string the media heading.
$body string the media content.
$src string | array URL for the media article source.
$img string | array URL for the media image source.
$srcOptions array html options for the media article link.
$imgOptions array html options for the media image.
$headingOptions array HTML attributes / options for the media object heading container.
$bodyOptions array HTML attributes / options for the media object body container.
$options array HTML attributes / options for the media object container.
$tag string the media container tag. Defaults to 'div'.
return string

mediaList() public static method

Example: ~~~ echo Html::mediaList([ [ 'heading' => 'Media heading 1', 'body' => 'Cras sit amet nibh libero, in gravida nulla. ' . 'Nulla vel metus scelerisque ante sollicitudin commodo. '. 'Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.', 'src' => '#', 'img' => 'http://placehold.it/64x64', 'items' => [ [ 'heading' => 'Media heading 1.1', 'body' => 'Cras sit amet nibh libero, in gravida nulla. ' . 'Nulla vel metus scelerisque ante sollicitudin commodo. ' . 'Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.', 'src' => '#', 'img' => 'http://placehold.it/64x64' ], [ 'heading' => 'Media heading 1.2', 'body' => 'Cras sit amet nibh libero, in gravida nulla. ' . 'Nulla vel metus scelerisque ante sollicitudin commodo. ' . 'Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.', 'src' => '#', 'img' => 'http://placehold.it/64x64' ], ] ], [ 'heading' => 'Media heading 2', 'body' => 'Cras sit amet nibh libero, in gravida nulla. ' . 'Nulla vel metus scelerisque ante sollicitudin commodo. ' . 'Cras purus odio, vestibulum in vulputate at, tempus viverra turpis.', 'src' => '#', 'img' => 'http://placehold.it/64x64' ], ]); ~~~
See also: http://getbootstrap.com/components/#media
public static mediaList ( array $items = [], array $options = [] ) : string
$items array the configuration of media items. The following properties can be set as array keys: - `items`: _array_, the sub media items (similar in configuration to items) (optional) - `heading`: _string_, the media heading - `body`: _string_, the media content - `src`: mixed, URL for the media article source - `img`: mixed, URL for the media image source - `srcOptions`: _array_, HTML attributes / options for the media article link (optional) - `imgOptions`: _array_, HTML attributes / options for the media image (optional) - `headingOptions`: _array_, HTML attributes / options for the media heading (optional) - `bodyOptions`: _array_, HTML attributes / options for the media body (optional) - `options`: _array_, HTML attributes / options for each media item (optional)
$options array HTML attributes / options for the media list container
return string

pageHeader() public static method

Example: ~~~ echo Html::pageHeader( 'Example page header', 'Subtext for header' ); ~~~
See also: http://getbootstrap.com/components/#page-header
public static pageHeader ( string $title, string $subTitle = '', array $options = [] ) : string
$title string the title to be shown
$subTitle string the subtitle to be shown as subtext within the title
$options array HTML attributes/ options for the page header
return string

panel() public static method

Example: ~~~ echo Html::panel([ 'heading' => 'Panel Title', 'body' => 'Panel Content', 'footer' => 'Panel Footer', ], Html::TYPE_PRIMARY); ~~~
See also: http://getbootstrap.com/components/#panels
public static panel ( array $content = [], string $type = 'default', array $options = [], string $prefix = 'panel panel-' ) : string
$content array the panel content configuration. The following properties can be setup: - `preHeading`: _string_, raw content that will be placed before `heading` (optional). - `heading`: _string_, the panel box heading (optional). - `preBody`: _string_, raw content that will be placed before $body (optional). - `body`: _string_, the panel body content - this will be wrapped in a "panel-body" container (optional). - `postBody`: _string_, raw content that will be placed after $body (optional). - `footer`: _string_, the panel box footer (optional). - `postFooter`: _string_, raw content that will be placed after $footer (optional). - `headingTitle`: _boolean_, whether to pre-style heading content with a '.panel-title' class. Defaults to `false`. - `footerTitle`: _boolean_, whether to pre-style footer content with a '.panel-title' class. Defaults to `false`.
$type string the panel type which can be one of the bootstrap color modifier constants. Defaults to [[TYPE_DEFAULT]]. - [[TYPE_DEFAULT]] or `default` - [[TYPE_PRIMARY]] or `primary` - [[TYPE_SUCCESS]] or `success` - [[TYPE_INFO]] or `info` - [[TYPE_WARNING]] or `warning` - [[TYPE_DANGER]] or `danger`
$options array HTML attributes / options for the panel container
$prefix string the CSS prefix for panel type. Defaults to `panel panel-`.
return string

radioButtonGroup() public static method

Example: ~~~ echo Html::radioButtonGroup('rdo', [1], [1 => 'Option 1', 2 => 'Option 2', 3 => 'Option 3']); ~~~
See also: http://getbootstrap.com/javascript/#buttons-checkbox-radio
public static radioButtonGroup ( string $name, string | array $selection = null, array $items = [], array $options = [] ) : string
$name string the name attribute of each radio.
$selection string | array the selected value(s).
$items array the data item used to generate the radios. The array keys are the radio values, while the array values are the corresponding labels.
$options array options (name => config) for the radio list container tag. The following options are specially handled: - `tag`: _string_, the tag name of the container element. - `unselect`: _string_, the value that should be submitted when none of the radio buttons is selected. By setting this option, a hidden input will be generated. - `encode`: boolean, whether to HTML-encode the radio button labels. Defaults to `true`. This option is ignored if `item` option is set. - `separator`: _string_, the HTML code that separates items. - `itemOptions`: _array_, the options for generating the radio button tag using [[radio()]]. - `item`: _Closure_, a callback that can be used to customize the generation of the HTML code corresponding to a single item in $items. The signature of this callback must be: ~~~ function ($index, $label, $name, $checked, $value) ~~~ where `$index` is the zero-based index of the radio button in the whole list; `$label` is the label for the radio button; and `$name`, `$value` and `$checked` represent the name, value and the checked status of the radio button input. See [[renderTagAttributes()]] for details on how attributes are being rendered.
return string the generated radio button group

well() public static method

Generates a well container.
See also: http://getbootstrap.com/components/#wells
public static well ( string $content, string $size = '', array $options = [] ) : string
$content string the content
$size string the well size. Should be one of the bootstrap size modifiers: - [[SIZE_TINY]] or `xs` - [[SIZE_SMALL]] or `sm` - [[SIZE_MEDIUM]] or `md` - [[SIZE_LARGE]] or `lg`
$options array HTML attributes / options for the well container.
return string