Example #1
0
 public function renderField()
 {
     if (!$this->is_display) {
         return '';
     }
     $format = $this->format ? $this->format : $this->name_form . '[' . $this->name . ']';
     $id = $this->id ? $this->id : $this->name_form . '_' . $this->name;
     return \Kodazzi\Helper\FormHtml::hidden($format, $this->value, $this->max_length, array('id' => $id, 'class' => $this->getClassCss()), $this->other_attributes);
 }
Example #2
0
 public function renderRow(\Kodazzi\Form\Field $widget)
 {
     if ($widget->isDisplay()) {
         // Si el formulario tiene una plantilla para todos los campos la agrega.
         if ($this->template_row) {
             $widget->setTemplate($this->template_row);
         }
         if ($widget->isHidden()) {
             $format = $widget->getFormat() ? $widget->getFormat() : $this->name_form . '[' . $widget->getName() . ']';
             return \Kodazzi\Helper\FormHtml::hidden($format, $widget->getValue(), $widget->getMaxlength(), array('id' => $widget->getId() ? $widget->getId() : $this->name_form . '_' . $widget->getName(), 'class' => $widget->getClassCss()));
         } else {
             $template = $widget->getTemplate();
             return Service::get('view')->render($template, array('widget' => $widget));
         }
     }
     return '';
 }