public function render(array $attributes = [], array $viewData = []) { $viewData['builder'] = $this->builder(); return parent::render($attributes, $viewData); }
/** * Determine the value of a field if a data source * is set and add it to the field itself. * * @param $field */ protected function setValue(AbstractType $field) { if (!$this->dataSource) { return; } $value = $this->getValue($field->getName()); if ($field instanceof Image) { $src = $this->dataSource instanceof ImageFieldSource ? $this->dataSource->getImagePath($field->getName()) : ''; $field->setSrc($src); } $field->setValue($value); $field->appendOption('value', $value); }