示例#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);
 }
示例#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);
 }
示例#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);
 }
示例#4
0
 public function __construct($content = null, array $attributes = [])
 {
     parent::__construct('span', $attributes, null);
     $this->setSingle(false)->setContent($content);
 }
示例#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);
 }
示例#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);
 }
示例#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);
 }
示例#8
0
 /**
  * @return string
  */
 public function render()
 {
     $this->makeSelected($this->getContent());
     return parent::render();
 }
示例#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);
 }
示例#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);
 }