Exemple #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();
 }
Exemple #2
0
 public function __construct($nodeValue = '', $attributes = array(), $childNodes = array())
 {
     $attributes = array_merge(array('type' => 'text'), $attributes);
     parent::__construct('input', $nodeValue, $attributes, $childNodes);
 }
Exemple #3
0
 public function errorTemplateNotFound()
 {
     $this->setInternalServerError();
     $html = new HTMLElement('html');
     $html->addChild('head', $head = new HTMLElement('head'));
     $html->addChild('body', $body = new HTMLElement('body'));
     $body->addChild('h1', $p = new HTMLElement('h1'));
     $p->setValue('Template non trovata<?php echo \'we\'; ?>');
     $this->getViewClass()->setTemplate($html);
 }