/** * Creates a new text form element. * * @param array $attributes The attributes that should be assigned to the text element. */ public function __construct(array $attributes) { parent::__construct($attributes); $this->type = 'image'; if (array_key_exists('value', $this->attributes) && !array_key_exists('src', $this->attributes)) { $this->attributes['src'] = $this->attributes['value']; unset($this->attributes['value']); } }
/** * Generates the HTML for the form element. * * @return string */ public function __toString() { $html = ''; if (isset($this->datalist)) { $html .= $this->datalist; $this->attributes['list'] = $this->datalist->getId(); } $html .= parent::__toString(); return $html; }
/** * Creates a new session form element. * * @param array $attributes The attributes that should be assigned to the session element. */ public function __construct(array $attributes) { parent::__construct($attributes); $this->type = 'session'; }
/** * Creates a new checkbox form element. * * @param array $attributes The attributes that should be assigned to the checkbox element. */ public function __construct(array $attributes) { parent::__construct($attributes); $this->type = 'checkbox'; }