Exemplo n.º 1
0
 /**
  * FormElement constructor.
  * @param string $action
  * @param string $method
  * @param bool|false $multipart
  * @param $content
  * @param array $attributes
  */
 public function __construct($action = '/', $method = 'get', $multipart = false, $content = null, array $attributes = [])
 {
     parent::__construct('form', $attributes, null);
     $this->setAttribute('action', $action)->setAttribute('method', strtoupper($method));
     if ($multipart === true) {
         $this->setAttribute('enctype', 'multipart/form-data');
     }
     $this->setContent($content);
 }
Exemplo n.º 2
0
 /**
  * H4Element constructor.
  * @param null $content
  * @param array $attributes
  */
 public function __construct($content = null, array $attributes = [])
 {
     parent::__construct('h4', $attributes, null);
     $this->setContent($content);
 }
Exemplo n.º 3
0
 /**
  * AElement constructor.
  * @param $href
  * @param null $content
  * @param array $attributes
  */
 public function __construct($href, $content = null, array $attributes = [])
 {
     parent::__construct('a', $attributes, null);
     $this->setSingle(false)->setAttribute('href', $href)->setContent($content);
 }
Exemplo n.º 4
0
 public function __construct($content = null, array $attributes = [])
 {
     parent::__construct('span', $attributes, null);
     $this->setSingle(false)->setContent($content);
 }
Exemplo n.º 5
0
 /**
  * InputElement constructor.
  * @param $name
  * @param null $value
  * @param array $attributes
  */
 public function __construct($name, $value = null, array $attributes = [])
 {
     parent::__construct('input', $attributes, null);
     $this->setSingle(true)->setAttribute('name', $name)->setAttribute('value', $value);
 }
Exemplo n.º 6
0
 /**
  * UlElement constructor.
  * @param array $userList
  * @param array $attributes
  */
 public function __construct(array $userList = [], array $attributes = [])
 {
     parent::__construct('ul', $attributes, null);
     $this->setSingle(false)->setContent($userList);
 }
Exemplo n.º 7
0
 /**
  * ButtonElement constructor.
  * @param $name
  * @param mixed $value
  * @param array $attributes
  */
 public function __construct($name, $value = null, array $attributes = [])
 {
     parent::__construct('button', $attributes, null);
     $this->setAttribute('name', $name)->setContent($value);
 }
Exemplo n.º 8
0
 /**
  * @return string
  */
 public function render()
 {
     $this->makeSelected($this->getContent());
     return parent::render();
 }
Exemplo n.º 9
0
 /**
  * ScriptElement constructor.
  * @param null $src
  * @param array $attributes
  */
 public function __construct($src = null, array $attributes = [])
 {
     parent::__construct('script', $attributes);
     $this->setAttribute('src', $src);
 }
Exemplo n.º 10
0
 /**
  * ImgElement constructor.
  * @param null $src
  * @param array $attributes
  */
 public function __construct($src = null, array $attributes = [])
 {
     parent::__construct('img', $attributes, null);
     $this->setAttribute('src', $src)->isSingle(true);
 }