Html
API reference › Bootstrap 6 › Html
Provides HTML helpers that render Bootstrap 6 markup.
See also: https://getbootstrap.com/docs/6.0/.
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$attributeOrder static | array | The preferred order of attributes in a tag. Default: ['type',. | yii\ |
$attributeRegex static | string | Regular expression used for attribute name validation. Default: '/(^|. Available since 2.0.12. | yii\ |
$autoIdPrefix static | string | Prefix of the id values generated for checkbox and radio labels. Default: 'i'. | BaseHtml |
$dataAttributes static | array | List of tag attributes that should be specially handled when their values are of array type. Default: ['aria',. Available since 2.0.3. | yii\ |
$normalizeClassAttribute static | bool | Whether to remove duplicated classes when rendering the class attribute. Default: true. | BaseHtml |
$voidElements static | array | List of void elements (element name => 1) Default: ['area' => 1,. | yii\ |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
a() static | Generates a hyperlink tag. | yii\ |
activeCheckbox() static | Generates a checkbox tag together with a label for the given model attribute. | yii\ |
activeCheckboxList() static | Generates a list of checkboxes. | yii\ |
activeDropDownList() static | Generates a drop-down list for the given model attribute. | yii\ |
activeFileInput() static | Generates a file input tag for the given model attribute. | yii\ |
activeHiddenInput() static | Generates a hidden input tag for the given model attribute. | yii\ |
activeHint() static | Generates a hint tag for the given model attribute. | yii\ |
activeInput() static | Generates an input tag for the given model attribute. | yii\ |
activeLabel() static | Generates a label tag for the given model attribute. | yii\ |
activeListBox() static | Generates a list box. | yii\ |
activePasswordInput() static | Generates a password input tag for the given model attribute. | yii\ |
activeRadio() static | Generates a radio button tag together with a label for the given model attribute. | yii\ |
activeRadioList() static | Generates a list of radio buttons. | yii\ |
activeStaticControl() static | Generates a static form control for the given model attribute. | BaseHtml |
activeTextarea() static | Generates a textarea tag for the given model attribute. | yii\ |
activeTextInput() static | Generates a text input tag for the given model attribute. | yii\ |
addCssClass() static | Adds CSS classes to the options; enum cases are converted to their value (backed) or name (pure). | BaseHtml |
addCssStyle() static | Adds the specified CSS style to the HTML options. | yii\ |
badge() static | Generates a badge. | BaseHtml |
beginForm() static | Generates a form start tag. | yii\ |
beginTag() static | Generates a start tag. | yii\ |
button() static | Generates a button tag. | yii\ |
buttonInput() static | Generates an input button. | yii\ |
checkbox() static | Generates a checkbox input. | yii\ |
checkboxList() static | Generates a list of Bootstrap checkboxes, each wrapped in a .form-field element. | BaseHtml |
closeButton() static | Generates a close button with a translated aria-label. | BaseHtml |
csrfMetaTags() static | Generates the meta tags containing CSRF token information. | yii\ |
cssFile() static | Generates a link tag that refers to an external CSS file. | yii\ |
cssStyleFromArray() static | Converts a CSS style array into a string representation. | yii\ |
cssStyleToArray() static | Converts a CSS style string into an array representation. | yii\ |
decode() static | Decodes special HTML entities back to the corresponding characters. | yii\ |
dropDownList() static | Generates a drop-down list. | yii\ |
encode() static | Encodes special characters into HTML entities. | yii\ |
endForm() static | Generates a form end tag. | yii\ |
endTag() static | Generates an end tag. | yii\ |
enumValue() static | Returns the string value of an enum-typed value, validating strings against the enum. | BaseHtml |
error() static | BaseHtml | |
errorSummary() static | Generates a summary of the validation errors. | yii\ |
escapeCssIdentifier() static | Escapes a string for use as a CSS identifier in a selector, as CSS.escape() does. | BaseHtml |
escapeJsRegularExpression() static | Escapes regular expression to use in JavaScript. | yii\ |
fileInput() static | Generates a file input field. | yii\ |
getAttributeName() static | Returns the real attribute name from the given attribute expression. | yii\ |
getAttributeValue() static | Returns the value of the specified attribute name or expression. | yii\ |
getInputId() static | Generates an appropriate input ID for the specified attribute name or expression. | yii\ |
getInputIdByName() static | Converts input name to ID. | yii\ |
getInputName() static | Generates an appropriate input name for the specified attribute name or expression. | yii\ |
hiddenInput() static | Generates a hidden input field. | yii\ |
img() static | Generates an image tag. | yii\ |
input() static | Generates an input type of the given type. | yii\ |
jsFile() static | Generates a script tag that refers to an external JavaScript file. | yii\ |
label() static | Generates a label tag. | yii\ |
listBox() static | Generates a list box. | yii\ |
mailto() static | Generates a mailto hyperlink. | yii\ |
ol() static | Generates an ordered list. | yii\ |
passwordInput() static | Generates a password input field. | yii\ |
radio() static | Generates a radio button input. | yii\ |
radioList() static | Generates a list of Bootstrap radios, each wrapped in a .form-field element. | BaseHtml |
removeCssClass() static | Removes a CSS class from the specified options. | yii\ |
removeCssStyle() static | Removes the specified CSS style from the HTML options. | yii\ |
renderSelectOptions() static | Renders the option tags that can be used by dropDownList() and listBox(). | yii\ |
renderTagAttributes() static | Renders the HTML tag attributes. | yii\ |
resetButton() static | Generates a reset button tag. | yii\ |
resetInput() static | Generates a reset input button. | yii\ |
script() static | Generates a script tag. | yii\ |
staticControl() static | Generates a read-only plain-text input. | BaseHtml |
style() static | Generates a style tag. | yii\ |
submitButton() static | Generates a submit button tag. | yii\ |
submitInput() static | Generates a submit input button. | yii\ |
tag() static | Generates a complete HTML tag. | yii\ |
textarea() static | Generates a text area input. | yii\ |
textInput() static | Generates a text input field. | yii\ |
theme() static | Adds the theme-{value} class to the options. | BaseHtml |
ul() static | Generates an unordered list. | yii\ |
activeBooleanInput() protected static | Generates a boolean input This method is mainly called by activeCheckbox() and activeRadio(). | yii\ |
activeListInput() protected static | Generates a list of input fields. | yii\ |
booleanInput() protected static | Generates a Bootstrap checkbox, switch, or radio. | BaseHtml |
getId() protected static | Returns the next auto-generated id for checkbox and radio labels. | BaseHtml |
setActivePlaceholder() protected static | Generate placeholder from model attribute label. | yii\ |