Свойство | Type | Description | |
---|---|---|---|
$errorOptions | the default options for the error tags. The parameter passed to yii\widgets\ActiveField::error()-detail) will be merged with this property when rendering the error tag. The following special options are recognized: - tag: the tag name of the container element. Defaults to "div". - encode: whether to encode the error output. Defaults to true. If you set a custom id for the error element, you may need to adjust the yii\widgets\ActiveField::$selectors accordingly. | ||
$hintOptions | the default options for the hint tags. The parameter passed to yii\widgets\ActiveField::hint()-detail) will be merged with this property when rendering the hint tag. The following special options are recognized: - tag: the tag name of the container element. Defaults to "div". | ||
$icon | the options for the optional prefix icon. To specify an icon you can use the following parameters php [ 'name' => 'name of the icon', // required 'options' => 'the HTML attributes for the img', // optional ] | ||
$inputOptions | the default options for the input tags. The parameter passed to individual input methods (e.g. textInput()-detail)) will be merged with this property when rendering the input tag. If you set a custom id for the input element, you may need to adjust the $selectors accordingly. | ||
$labelOptions | the default options for the label tags. The parameter passed to label()-detail) will be merged with this property when rendering the label tag. | ||
$options | the HTML attributes (name-value pairs) for the field container tag. The values will be HTML-encoded using Html::encode()-detail). If a value is null, the corresponding attribute will not be rendered. The following special options are recognized: - tag: the tag name of the container element. Defaults to "div". If you set a custom id for the container element, you may need to adjust the $selectors accordingly. | ||
$template | the template that is used to arrange the label, the input field, the error message and the hint text. The following tokens will be replaced when ActiveField::render is called: {label}, {input}, {error} and {hint}. |
Méthode | Description | |
---|---|---|
colorInput ( array $options = [] ) : |
Renders a color input. | |
dateInput ( array $options = [] ) : |
Renders a date input. | |
datetimeInput ( array $options = [] ) : |
Renders a datetime input. | |
datetimeLocalInput ( array $options = [] ) : |
Renders a datetime local input. | |
emailInput ( array $options = [] ) : |
Renders an email input. | |
icon ( ) : |
Renders an icon. | |
init ( ) | Initializes the widget. | |
monthInput ( array $options = [] ) : |
Renders a month input. | |
numberInput ( array $options = [] ) : |
Renders a number input. | |
rangeInput ( array $options = [] ) : |
Renders a range input. | |
render ( string | callable $content = null ) : string | Renders the whole field. | |
searchInput ( array $options = [] ) : |
Renders a search input. | |
telInput ( array $options = [] ) : |
Renders a phone input. | |
textarea ( array $options = [] ) : |
Renders a textarea. | |
timeInput ( array $options = [] ) : |
Renders a time input. | |
urlInput ( array $options = [] ) : |
Renders an URL input. | |
weekInput ( array $options = [] ) : |
Renders a week input. |
public colorInput ( array $options = [] ) : |
||
$options | array | |
Résultat |
public datetimeInput ( array $options = [] ) : |
||
$options | array | |
Résultat |
public datetimeLocalInput ( array $options = [] ) : |
||
$options | array | |
Résultat |
public emailInput ( array $options = [] ) : |
||
$options | array | |
Résultat |
public monthInput ( array $options = [] ) : |
||
$options | array | |
Résultat |
public numberInput ( array $options = [] ) : |
||
$options | array | |
Résultat |
public rangeInput ( array $options = [] ) : |
||
$options | array | |
Résultat |
public render ( string | callable $content = null ) : string | ||
$content | string | callable | the content within the field container. If null (not set), the default methods will be called to generate the label, error tag and input tag, and use them as the content. If a callable, it will be called to generate the content. The signature of the callable should be: ```php function ($field) { return $html; } ``` |
Résultat | string | the rendering result |
public searchInput ( array $options = [] ) : |
||
$options | array | |
Résultat |
public $errorOptions |
public $hintOptions |
public $icon |
public $inputOptions |
public $labelOptions |
public $options |
public $template |