Class yii\bootstrap\BaseHtml

Inheritanceyii\bootstrap\BaseHtml » yii\helpers\Html
Subclassesyii\bootstrap\Html
Available since version2.0.5

BaseHtml provides concrete implementation for yii\bootstrap\Html.

Do not use BaseHtml. Use yii\bootstrap\Html instead.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
activeStaticControl() Generates a Bootstrap static form control for the given model attribute. yii\bootstrap\BaseHtml
checkboxList() yii\bootstrap\BaseHtml
error() yii\bootstrap\BaseHtml
icon() Composes icon HTML for bootstrap Glyphicons. yii\bootstrap\BaseHtml
radioList() yii\bootstrap\BaseHtml
staticControl() Renders Bootstrap static form control. yii\bootstrap\BaseHtml

Method Details

activeStaticControl() public static method

Generates a Bootstrap static form control for the given model attribute.

See also staticControl().

public static string activeStaticControl ( $model, $attribute, $options = [] )
$model \yii\base\Model

The model object.

$attribute string

The attribute name or expression. See \yii\bootstrap\getAttributeName() for the format about attribute expression.

$options array

The tag options in terms of name-value pairs. See staticControl() for details.

return string

Generated HTML

checkboxList() public static method (available since version 2.0.8)

public static void checkboxList ( $name, $selection null, $items = [], $options = [] )
$name
$selection
$items
$options
error() public static method (available since version 2.0.8)

public static void error ( $model, $attribute, $options = [] )
$model
$attribute
$options
icon() public static method

Composes icon HTML for bootstrap Glyphicons.

See also http://getbootstrap.com/components/#glyphicons.

public static string icon ( $name, $options = [] )
$name string

Icon short name, for example: 'star'

$options array

The tag options in terms of name-value pairs. These will be rendered as the attributes of the resulting tag. There are also a special options:

  • tag: string, tag to be rendered, by default 'span' is used.
  • prefix: string, prefix which should be used to compose tag class, by default 'glyphicon glyphicon-' is used.
return string

Icon HTML.

radioList() public static method (available since version 2.0.8)

public static void radioList ( $name, $selection null, $items = [], $options = [] )
$name
$selection
$items
$options
staticControl() public static method

Renders Bootstrap static form control.

By default value will be HTML-encoded using \yii\bootstrap\encode(), you may control this behavior via 'encode' option.

See also http://getbootstrap.com/css/#forms-controls-static.

public static string staticControl ( $value, $options = [] )
$value string

Static control value.

$options array

The tag options in terms of name-value pairs. These will be rendered as the attributes of the resulting tag. There are also a special options:

  • encode: bool, whether value should be HTML-encoded or not.
return string

Generated HTML