Example #1
0
 public function addHeader(array $header)
 {
     $this->addHead();
     $row = new BaseNode("th");
     foreach ($header as $item) {
         $rowContent = new basenode("td");
         $rowContent->setText($item);
         $row->addChildren($rowContent);
     }
     $this->head->addChildren($row);
 }
Example #2
0
 public function __construct($for, $name = null)
 {
     parent::__construct("label");
     $this->setProperty("for", $for);
     if ($name == null) {
         $name = $for;
     }
     $this->setText($name);
 }
Example #3
0
 public function __construct($id, $placeholder, $required = true)
 {
     parent::__construct("textarea", $id);
     $this->setProperty("placeholder", $placeholder);
     $this->setProperty("rows", "5");
     if ($required) {
         $this->setAttribute("required");
     }
 }
Example #4
0
 public function __construct($type, $id, $placeholder, $required = true)
 {
     parent::__construct("input", $id);
     $this->setProperty("placeholder", $placeholder);
     $this->setProperty("type", $type);
     if ($required) {
         $this->setAttribute("required");
     }
 }
Example #5
0
 public function __construct($link, $text = null, $alt = null, $target = "_blank", $showText = true)
 {
     parent::__construct("a");
     $this->link = $link;
     if ($showText) {
         if ($text == null) {
             $this->setText($link);
         } else {
             $this->setText($text);
         }
     }
     if ($alt == null) {
         $this->alt = $text;
     } else {
         $this->alt = $alt;
     }
     $this->target = $target;
 }
Example #6
0
 public function __construct()
 {
     parent::__construct("p");
 }
Example #7
0
 public function __construct($id = null)
 {
     parent::__construct("div", $id);
 }
Example #8
0
 public function __construct($text, $id = null)
 {
     parent::__construct("button", $id);
     $this->setText($text);
 }