/** * initialize a <button> element instance * * $type defaults to 'button' * * @param string $name * @param string $value * @param string $type */ public function __construct($name, $value = NULL, $type = NULL) { parent::__construct($name, $value); if (isset($type)) { $this->setType($type); } else { $this->attributes['type'] = 'button'; } }
/** * inialize a <input type="checkbox"> element instance * * @param string $name * @param string $value * @param boolean $checked * @param string $label */ public function __construct($name, $value = NULL, $checked = FALSE, $label = NULL) { parent::__construct($name, $value); $this->setChecked($checked); $this->setLabel($label); }
/** * inialize a <input type="image"> element instance * * @param string $name * @param string $value * @param string $src */ public function __construct($name, $value = NULL, $src) { parent::__construct($name, $value); $this->setAttribute('alt', pathinfo($src, PATHINFO_FILENAME)); }