/** * 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); }
/** * H4Element constructor. * @param null $content * @param array $attributes */ public function __construct($content = null, array $attributes = []) { parent::__construct('h4', $attributes, null); $this->setContent($content); }
/** * 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); }
public function __construct($content = null, array $attributes = []) { parent::__construct('span', $attributes, null); $this->setSingle(false)->setContent($content); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * @return string */ public function render() { $this->makeSelected($this->getContent()); return parent::render(); }
/** * ScriptElement constructor. * @param null $src * @param array $attributes */ public function __construct($src = null, array $attributes = []) { parent::__construct('script', $attributes); $this->setAttribute('src', $src); }
/** * 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); }