Ejemplo n.º 1
0
 /**
  * TableSection constructor.
  *
  * @param $tag
  * @param $rows
  * @param bool $header
  */
 public function __construct($tag, $rows, $header = false)
 {
     parent::__construct($tag);
     $this->header = $header;
     foreach ($rows as $row) {
         $this->rows[] = new TableRow($row, $header);
     }
 }
Ejemplo n.º 2
0
 public function __construct($type, $attributes = null)
 {
     $tagName = isset($this->fieldTypes[$type]) ? $this->fieldTypes[$type] : $type;
     $container = !in_array($tagName, $this->fieldsNotContainerTypes);
     parent::__construct($tagName, $container);
     if (in_array(strtolower($tagName), $this->fieldsHavingTypesAttr)) {
         $this->setAttribute('type', $type);
     }
     is_array($attributes) or $attributes = array('name' => $attributes);
     if (isset($attributes['name'])) {
         $container ? $this->addText($attributes['name']) : $this->setAttribute('name', $attributes['name']);
         unset($attributes['name']);
     }
     foreach ($attributes as $attribute => $value) {
         $this->setAttribute($attribute, $value);
     }
 }
Ejemplo n.º 3
0
 /**
  * TableCell constructor.
  *
  * @param $content
  */
 public function __construct($content)
 {
     parent::__construct($this->tag);
     $this->content = $content;
 }