Exemplo n.º 1
0
 public function render(array $attributes = [], array $viewData = [])
 {
     $viewData['builder'] = $this->builder();
     return parent::render($attributes, $viewData);
 }
Exemplo n.º 2
0
 /**
  * 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);
 }