Skip to content
PHP Ecosystem
Explore

Html

API reference › Bootstrap 6 › Html

final classyii2\extensions\bootstrap6\Html
ExtendsBaseHtml » yii\helpers\Html » yii\helpers\BaseHtml
Sourcesrc/Html.php

Provides HTML helpers that render Bootstrap 6 markup.

See also: https://getbootstrap.com/docs/6.0/.

PropertyTypeDescriptionDefined by
$attributeOrder staticarrayThe preferred order of attributes in a tag. Default: ['type', 'id', 'class', 'name', 'value', 'href', 'src', 'srcset', 'form', 'action', 'method', 'selected', 'checked', 'readonly', 'disabled', 'multiple', 'size', 'maxlength', 'width', 'height', 'rows', 'cols', 'alt', 'title', 'rel', 'media'].yii\helpers\BaseHtml
$attributeRegex staticstringRegular expression used for attribute name validation. Default: '/(^|.*\])([\w\.\+]+)(\[.*|$)/u'. Available since 2.0.12.yii\helpers\BaseHtml
$autoIdPrefix staticstringPrefix of the id values generated for checkbox and radio labels. Default: 'i'.BaseHtml
$dataAttributes staticarrayList of tag attributes that should be specially handled when their values are of array type. Default: ['aria', 'data', 'data-ng', 'ng']. Available since 2.0.3.yii\helpers\BaseHtml
$normalizeClassAttribute staticboolWhether to remove duplicated classes when rendering the class attribute. Default: true.BaseHtml
$voidElements staticarrayList of void elements (element name => 1) Default: ['area' => 1, 'base' => 1, 'br' => 1, 'col' => 1, 'command' => 1, 'embed' => 1, 'hr' => 1, 'img' => 1, 'input' => 1, 'keygen' => 1, 'link' => 1, 'meta' => 1, 'param' => 1, 'source' => 1, 'track' => 1, 'wbr' => 1].yii\helpers\BaseHtml
MethodDescriptionDefined by
a() staticGenerates a hyperlink tag.yii\helpers\BaseHtml
activeCheckbox() staticGenerates a checkbox tag together with a label for the given model attribute.yii\helpers\BaseHtml
activeCheckboxList() staticGenerates a list of checkboxes.yii\helpers\BaseHtml
activeDropDownList() staticGenerates a drop-down list for the given model attribute.yii\helpers\BaseHtml
activeFileInput() staticGenerates a file input tag for the given model attribute.yii\helpers\BaseHtml
activeHiddenInput() staticGenerates a hidden input tag for the given model attribute.yii\helpers\BaseHtml
activeHint() staticGenerates a hint tag for the given model attribute.yii\helpers\BaseHtml
activeInput() staticGenerates an input tag for the given model attribute.yii\helpers\BaseHtml
activeLabel() staticGenerates a label tag for the given model attribute.yii\helpers\BaseHtml
activeListBox() staticGenerates a list box.yii\helpers\BaseHtml
activePasswordInput() staticGenerates a password input tag for the given model attribute.yii\helpers\BaseHtml
activeRadio() staticGenerates a radio button tag together with a label for the given model attribute.yii\helpers\BaseHtml
activeRadioList() staticGenerates a list of radio buttons.yii\helpers\BaseHtml
activeStaticControl() staticGenerates a static form control for the given model attribute.BaseHtml
activeTextarea() staticGenerates a textarea tag for the given model attribute.yii\helpers\BaseHtml
activeTextInput() staticGenerates a text input tag for the given model attribute.yii\helpers\BaseHtml
addCssClass() staticAdds CSS classes to the options; enum cases are converted to their value (backed) or name (pure).BaseHtml
addCssStyle() staticAdds the specified CSS style to the HTML options.yii\helpers\BaseHtml
badge() staticGenerates a badge.BaseHtml
beginForm() staticGenerates a form start tag.yii\helpers\BaseHtml
beginTag() staticGenerates a start tag.yii\helpers\BaseHtml
button() staticGenerates a button tag.yii\helpers\BaseHtml
buttonInput() staticGenerates an input button.yii\helpers\BaseHtml
checkbox() staticGenerates a checkbox input.yii\helpers\BaseHtml
checkboxList() staticGenerates a list of Bootstrap checkboxes, each wrapped in a .form-field element.BaseHtml
closeButton() staticGenerates a close button with a translated aria-label.BaseHtml
csrfMetaTags() staticGenerates the meta tags containing CSRF token information.yii\helpers\BaseHtml
cssFile() staticGenerates a link tag that refers to an external CSS file.yii\helpers\BaseHtml
cssStyleFromArray() staticConverts a CSS style array into a string representation.yii\helpers\BaseHtml
cssStyleToArray() staticConverts a CSS style string into an array representation.yii\helpers\BaseHtml
decode() staticDecodes special HTML entities back to the corresponding characters.yii\helpers\BaseHtml
dropDownList() staticGenerates a drop-down list.yii\helpers\BaseHtml
encode() staticEncodes special characters into HTML entities.yii\helpers\BaseHtml
endForm() staticGenerates a form end tag.yii\helpers\BaseHtml
endTag() staticGenerates an end tag.yii\helpers\BaseHtml
enumValue() staticReturns the string value of an enum-typed value, validating strings against the enum.BaseHtml
error() staticBaseHtml
errorSummary() staticGenerates a summary of the validation errors.yii\helpers\BaseHtml
escapeCssIdentifier() staticEscapes a string for use as a CSS identifier in a selector, as CSS.escape() does.BaseHtml
escapeJsRegularExpression() staticEscapes regular expression to use in JavaScript.yii\helpers\BaseHtml
fileInput() staticGenerates a file input field.yii\helpers\BaseHtml
getAttributeName() staticReturns the real attribute name from the given attribute expression.yii\helpers\BaseHtml
getAttributeValue() staticReturns the value of the specified attribute name or expression.yii\helpers\BaseHtml
getInputId() staticGenerates an appropriate input ID for the specified attribute name or expression.yii\helpers\BaseHtml
getInputIdByName() staticConverts input name to ID.yii\helpers\BaseHtml
getInputName() staticGenerates an appropriate input name for the specified attribute name or expression.yii\helpers\BaseHtml
hiddenInput() staticGenerates a hidden input field.yii\helpers\BaseHtml
img() staticGenerates an image tag.yii\helpers\BaseHtml
input() staticGenerates an input type of the given type.yii\helpers\BaseHtml
jsFile() staticGenerates a script tag that refers to an external JavaScript file.yii\helpers\BaseHtml
label() staticGenerates a label tag.yii\helpers\BaseHtml
listBox() staticGenerates a list box.yii\helpers\BaseHtml
mailto() staticGenerates a mailto hyperlink.yii\helpers\BaseHtml
ol() staticGenerates an ordered list.yii\helpers\BaseHtml
passwordInput() staticGenerates a password input field.yii\helpers\BaseHtml
radio() staticGenerates a radio button input.yii\helpers\BaseHtml
radioList() staticGenerates a list of Bootstrap radios, each wrapped in a .form-field element.BaseHtml
removeCssClass() staticRemoves a CSS class from the specified options.yii\helpers\BaseHtml
removeCssStyle() staticRemoves the specified CSS style from the HTML options.yii\helpers\BaseHtml
renderSelectOptions() staticRenders the option tags that can be used by dropDownList() and listBox().yii\helpers\BaseHtml
renderTagAttributes() staticRenders the HTML tag attributes.yii\helpers\BaseHtml
resetButton() staticGenerates a reset button tag.yii\helpers\BaseHtml
resetInput() staticGenerates a reset input button.yii\helpers\BaseHtml
script() staticGenerates a script tag.yii\helpers\BaseHtml
staticControl() staticGenerates a read-only plain-text input.BaseHtml
style() staticGenerates a style tag.yii\helpers\BaseHtml
submitButton() staticGenerates a submit button tag.yii\helpers\BaseHtml
submitInput() staticGenerates a submit input button.yii\helpers\BaseHtml
tag() staticGenerates a complete HTML tag.yii\helpers\BaseHtml
textarea() staticGenerates a text area input.yii\helpers\BaseHtml
textInput() staticGenerates a text input field.yii\helpers\BaseHtml
theme() staticAdds the theme-{value} class to the options.BaseHtml
ul() staticGenerates an unordered list.yii\helpers\BaseHtml
activeBooleanInput() protected staticGenerates a boolean input This method is mainly called by activeCheckbox() and activeRadio().yii\helpers\BaseHtml
activeListInput() protected staticGenerates a list of input fields.yii\helpers\BaseHtml
booleanInput() protected staticGenerates a Bootstrap checkbox, switch, or radio.BaseHtml
getId() protected staticReturns the next auto-generated id for checkbox and radio labels.BaseHtml
setActivePlaceholder() protected staticGenerate placeholder from model attribute label.yii\helpers\BaseHtml