renderWidget() защищенный Метод

Renders a widget.
protected renderWidget ( $type, $name, $value, $options ) : mixed
$type
$name
$value
$options
Результат mixed
 /**
  * @inheritdoc
  */
 protected function renderWidget($type, $name, $value, $options)
 {
     // Extend options in case of rendering embedded MultipleInput
     // We have to pass to the widget an original model and an attribute to be able get a first error from model
     // for embedded widget.
     if ($type === MultipleInput::className()) {
         $model = $this->context->model;
         // in case of embedding level 2 and more
         if (preg_match('/^([\\w\\.]+)(\\[.*)$/', $this->context->attribute, $matches)) {
             $search = sprintf('%s[%s]%s', $model->formName(), $matches[1], $matches[2]);
         } else {
             $search = sprintf('%s[%s]', $model->formName(), $this->context->attribute);
         }
         $replace = $this->context->attribute;
         $attribute = str_replace($search, $replace, $name);
         $options['model'] = $model;
         $options['attribute'] = $attribute;
         // Remember current name and mark the widget as embedded to prevent
         // generation of wrong prefix in case when column is associated with AR relation
         // @see https://github.com/unclead/yii2-multiple-input/issues/92
         $options['name'] = $name;
         $options['isEmbedded'] = true;
     }
     return parent::renderWidget($type, $name, $value, $options);
 }