Class yii\bootstrap4\BaseHtml

Inheritanceyii\bootstrap4\BaseHtml » yii\helpers\Html
Subclassesyii\bootstrap4\Html

BaseHtml provides concrete implementation for yii\bootstrap4\Html.

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

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$autoIdPrefix string The prefix to the automatically generated widget IDs. yii\bootstrap4\BaseHtml
$counter integer A counter used to generate \yii\bootstrap4\id for widgets. yii\bootstrap4\BaseHtml
$dataAttributes array List of tag attributes that should be specially handled when their values are of array type. yii\bootstrap4\BaseHtml

Public Methods

Hide inherited methods

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

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
booleanInput() yii\bootstrap4\BaseHtml
getId() Returns an autogenerated ID yii\bootstrap4\BaseHtml

Property Details

$autoIdPrefix public static property

The prefix to the automatically generated widget IDs.

See also getId().

public static string $autoIdPrefix 'i'
$counter public static property

A counter used to generate \yii\bootstrap4\id for widgets.

public static integer $counter 0
$dataAttributes public static property (available since version 2.0.3)

List of tag attributes that should be specially handled when their values are of array type. In particular, if the value of the data attribute is ['name' => 'xyz', 'age' => 13], two attributes will be generated instead of one: data-name="xyz" data-age="13".

public static array $dataAttributes = ['data''data-ng''ng''aria']

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\bootstrap4\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

booleanInput() protected static method

protected static void booleanInput ( $type, $name, $checked false, $options = [] )
$type
$name
$checked
$options
checkboxList() public static method

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

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

Returns an autogenerated ID

protected static string getId ( )
return string

Autogenerated ID

radioList() public static method

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

Renders Bootstrap static form control.

See also https://getbootstrap.com/docs/4.2/components/forms/#readonly-plain-text.

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:

return string

Generated HTML