yii\helpers\BaseHtml::activeListInput PHP Метод

activeListInput() защищенный статический Метод

protected static activeListInput ( string $type, Model $model, string $attribute, array $items, array $options = [] ) : string
$type string the input type. This can be 'listBox', 'radioList', or 'checkBoxList'.
$model yii\base\Model the model object
$attribute string the attribute name or expression. See [[getAttributeName()]] for the format about attribute expression.
$items array the data item used to generate the input fields. The array keys are the input values, and the array values are the corresponding labels. Note that the labels will NOT be HTML-encoded, while the values will.
$options array options (name => config) for the input list. The supported special options depend on the input type specified by `$type`.
Результат string the generated input list
    protected static function activeListInput($type, $model, $attribute, $items, $options = [])
    {
        $name = isset($options['name']) ? $options['name'] : static::getInputName($model, $attribute);
        $selection = isset($options['value']) ? $options['value'] : static::getAttributeValue($model, $attribute);
        if (!array_key_exists('unselect', $options)) {
            $options['unselect'] = '';
        }
        if (!array_key_exists('id', $options)) {
            $options['id'] = static::getInputId($model, $attribute);
        }
        return static::$type($name, $selection, $items, $options);
    }