the attribute settings. This is an associative array, which needs to be setup as
$attribute_name => $attribute_settings, where:
- attribute_name: _string_, the name of the attribute
- attribute_settings: _array_, the settings for the attribute, where you can set the following:
- 'type': string, the input type for the attribute. Should be one of the INPUT_ constants. Defaults to
INPUT_TEXT.
- 'visible': boolean, whether the attribute is visible. One can use this property to control visibility of
attributes conditionally.
- 'attributes': array, the nested group of sub attributes that will be grouped together, this configuration
will be similar to the parent attributes. The label property will be auto set to false for each sub
attribute.
- 'value': string|Closure, the value to be displayed if the type is set to INPUT_RAW or INPUT_STATIC.
This will display the raw text from value field if it is a string. If this is a Closure, your anonymous
function call should be of the type: function ($model, $key, $index, $widget) { }, where $model is the
current model, $key is the key associated with the data model $index is the zero based index of the
dataProvider, and $widget is the current widget instance.
- 'staticValue': string|Closure, the value to be displayed for INPUT_STATIC. If not set, the value will be
automatically generated from the value setting above OR from the value of the model attribute. If this is
setup as a [[Closure]], your anonymous function call should be of the type:
function ($model, $key, $index, $widget) { }, where $model is the current model, $key is the key
associated with the data model, $index is the zero based index of the dataProvider, and $widget is the
current widget instance.
- 'format': string|array, applicable only for INPUT_STATIC type (and only in tabular forms). This controls
which format should the value of each data model be displayed as (e.g. "raw", "text", "html",
['date', 'php:Y-m-d']). Supported formats are determined by [Yii::$app->formatter]. Default format is
"raw".
- 'hiddenStaticOptions': array, HTML attributes for the static control container and applicable only for
[[INPUT_HIDDEN_STATIC]] type.
- 'label': string, (optional) the custom attribute label. If this is not set, the model attribute label
will be automatically used. If you set it to false, the label will be entirely hidden.
- 'labelSpan': int, the grid span width of the label container, which is especially useful for horizontal
forms. If not set this will be derived automatically from the formConfig['labelSpan'] property of $form
(ActiveForm).
- 'labelOptions': array, (optional) the HTML attributes for the label. Will be applied only when NOT using
with active form and only if label is set.
- 'prepend': string, (optional) any markup to prepend before the input. For ActiveForm fields, this content
will be prepended before the field group (including label, input, error, hint blocks).
- 'append': string, (optional) any markup to append before the input. For ActiveForm fields, this content
will be appended after the field group (including label, input, error, hint blocks).
- 'container': array, (optional) HTML attributes for the div container to wrap the input. For ActiveForm,
this will envelop the field group (including label, input, error, hint blocks). If not set or empty, no
container will be wrapped.
- 'inputContainer': array, (optional) HTML attributes for the div container to wrap the
input control only. If not set or empty, no container will be wrapped. Will be applied
only when NOT using with ActiveForm.
- 'fieldConfig': array, the configuration for the active field.
- hint: string, the hint text to be shown below the active field.
- 'items': array, the list of items if input type is one of the following:
INPUT_DROPDOWN_LIST, INPUT_LIST_BOX, INPUT_CHECKBOX_LIST, INPUT_RADIO_LIST, INPUT_MULTISELECT
INPUT_CHECKBOX_BUTTON_GROUP, INPUT_RADIO_BUTTON_GROUP
- enclosedByLabel: bool, if the INPUT_CHECKBOX or INPUT_RADIO is to be enclosed by label. Defaults
to true.
- html5type: string, the type of HTML5 input, if input type is set to INPUT_HTML5.
- 'widgetClass': string, the classname if input type is INPUT_WIDGET.
- 'options': array, the HTML attributes or widget settings to be applied to the input.
- 'columnOptions': array, for a Form, it will override columnOptions setup at Form level. For
a TabularForm it will allow you to append additional column options for the grid data column.