Exemplo n.º 1
0
 /**
  * Il metodo render richiama il metodo toString() della classe HTMLElementCore
  * Se si vogliono usare dei render custom e non si vuole overridare il metodo render() di questa classe
  * E' necessario che le classi render utilizzate abbiano il metodo toString che restituiscono una stringa
  * cnotenente il codice html dell'elemento
  * @return String
  */
 public function render()
 {
     $form = new HTMLElement('form');
     $form->addAttribute('name', $this->getName());
     $form->addAttribute('action', $this->getAction());
     $form->addAttribute('method', $this->getMethod());
     foreach ($this->_elements as $name => $element) {
         $render = $element['render'];
         $form->addChild($name, $render);
     }
     return $form->toString();
 }