Example #1
0
File: Input.php Project: xiphe/html
 /**
  * Module Logic
  *
  * @return void
  */
 public function execute()
 {
     switch ($this->called) {
         case 'textarea':
             $Tag = new HTML\Tag($this->called, array($this->args[0], $this->args[1]), array('generate', 'inlineInner'));
             break;
         default:
             $Tag = new HTML\Tag($this->called, array($this->args[0]), array('generate'));
             break;
     }
     if ($this->called == 'checkbox' && isset($this->args[2]) && ($this->args[2] === true || $this->args[2] === 'on' || $this->args[2] === 1 || $this->args[2] === $Tag->attributes['id'] || is_array($this->args[2]) && in_array($Tag->attributes['id'], $this->args[2]))) {
         $Tag->setAttrs(array('checked' => null));
     }
     if ($this->_label !== false) {
         $Label = HTML\Generator::getLabel($this->_label, $Tag);
         HTML\Generator::appendLabel($Label, $Tag, $this->_label);
     } else {
         echo $Tag;
     }
 }
Example #2
0
 /**
  * Returns the head tag.
  *
  * @return Tag
  */
 public function getHead()
 {
     $head = new Core\Tag('head', array(isset($this->args[0]) ? $this->args[0] : null), array('generate', 'start'));
     $head->setAttrs($this->headattrs);
     return $head;
 }