Exemplo n.º 1
0
 public function getTemplate(PhpRenderer $view)
 {
     // Normalize vocab terms for use in a select element.
     $terms = array_map('trim', explode(PHP_EOL, $this->vocab->terms()));
     $valueOptions = array_combine($terms, $terms);
     $hidden = new Hidden('customvocab');
     $hidden->setAttributes(['class' => 'language'])->setValue($this->vocab->lang());
     $select = new Select('customvocab');
     $select->setAttributes(['class' => 'terms'])->setEmptyOption('Select Below')->setValueOptions($valueOptions);
     return $view->formHidden($hidden) . $view->formSelect($select);
 }
Exemplo n.º 2
0
 /**
  * Render the form
  *
  * @param \Zend\View\Renderer\PhpRenderer $view
  * @return string HTML form code
  */
 public function render(\Zend\View\Renderer\PhpRenderer $view)
 {
     $this->prepare();
     $output = $view->form()->openTag($this);
     $output .= "\n";
     if ($this->has('_csrf')) {
         $output .= "<div>";
         $output .= $view->formHidden($this->get('_csrf'));
         $output .= "</div>\n";
     }
     $output .= $this->renderFieldset($view, $this);
     $output .= "\n";
     $output .= $view->form()->closeTag();
     $output .= "\n";
     return $output;
 }
Exemplo n.º 3
0
 /**
  * Render the form
  *
  * @param \Zend\View\Renderer\PhpRenderer $view
  * @return string HTML form code
  */
 public function render(\Zend\View\Renderer\PhpRenderer $view)
 {
     $output = '';
     if ($this->_errorPostMaxSize) {
         $output .= $view->htmlElement('p', sprintf($view->translate('The post_max_size value of %s has been exceeded.'), ini_get('post_max_size')), array('class' => 'error'));
     }
     $this->prepare();
     $output .= $view->form()->openTag($this);
     $output .= "\n";
     if ($this->has('_csrf')) {
         $output .= "<div>";
         $output .= $view->formHidden($this->get('_csrf'));
         $output .= "</div>\n";
     }
     $output .= $this->renderFieldset($view, $this);
     $output .= "\n";
     $output .= $view->form()->closeTag();
     $output .= "\n";
     return $output;
 }