Example #1
0
 public function setWidget($name, Field $widget)
 {
     $nameTranslation = null;
     $keyTranslation = $this->getNameForm() . '.' . $name;
     // Verifica si en el catalog existe una traduccion para el campo.
     if ($this->I18n->getCatalogue()->has($keyTranslation)) {
         $nameTranslation = $this->I18n->get($keyTranslation);
     }
     $widget->setName(strtolower($name));
     $widget->setValueLabel($nameTranslation);
     $widget->setNameForm($this->name_form);
     $widget->setForm($this);
     $widget->setI18n($this->I18n);
     $widget->setConfig($this->config_fields);
     $widget->setPathUpload($this->path_upload);
     $this->widgets[$name] = $widget;
     return $widget;
 }