Example #1
0
 public function loadConfiguration()
 {
     $obj = new Configuration();
     $config = $obj->loadCampoConfiguration($this->getForm()->getAttrib('name'), $this->getName());
     if (null === $config) {
         return $this;
     }
     if ($config->isEmpty()) {
         return $this;
     }
     $required = 's' === $config->getNotnull();
     $label = array();
     if ($required) {
         if (array_key_exists('class', $label)) {
             $class = $label['class'] . ' required';
             $label['class'] = $class;
         }
     }
     $this->setRequired($required);
     $this->setAttrib('maxlength', $config->getMaxlength());
     if ($config->getLabel()) {
         $label['label'] = $config->getLabel();
     }
     if (method_exists($config, 'getLabelClass')) {
         if ($config->getLabelclass()) {
             if (array_key_exists('class', $label)) {
                 $class = $label['class'] . ' ' . $config->getLabelclass();
                 $label['class'] = $class;
             } else {
                 $label['class'] = $config->getLabelclass();
             }
         }
     }
     //$this->_label = new \Life\Form\Element\Label('label');
     //$this->_label->setAttribs($label);
     $this->setLabel($label);
     if ($config->getPlaceholder()) {
         $this->setAttrib('placeholder', $config->getPlaceholder());
     }
     if ($config->getExternalHTML()) {
         $this->setExternalHTML($config->getExternalHTML());
     }
     if ($config->getContent()) {
         $this->setContent($config->getContent());
     }
     if ($config->getSeparador()) {
         $this->setSeparator($config->getSeparador());
     }
     if ($config->getErrorHTML()) {
         $this->setErrorHTML($config->getErrorHTML());
     }
     return $this;
 }
Example #2
0
 public function loadConfiguration()
 {
     parent::loadConfiguration();
     $obj = new Configuration();
     $config = $obj->loadCampoConfiguration($this->form->getAttrib('name'), $this->getName());
     if (null === $config) {
         return $this;
     }
     if ($config->isEmpty()) {
         return $this;
     }
     if ($config->getMultiExternalHTML()) {
         $this->setMultiExternalHTML($config->getMultiExternalHTML());
     }
     if ($config->getSeparador()) {
         $this->setSeparator($config->getSeparador());
     }
     return $this;
 }