/** * @param string $name The name of this form element * @param array $options The available options * @param string $label The label text for this element (will be autoescaped) */ public function __construct($name, $options, $label = '') { parent::__construct('dropdown', $name, $label); $this->rmattr('type'); $this->optGroups[''] = new OptGroup(null, $options); $this->val(''); }
/** * @param string $name The name of this form element * @param string $label The label text for this element */ public function __construct($name, $label) { parent::__construct('textarea', $name, $label); $this->attr('dir', 'auto'); }
public function __construct() { parent::__construct(); }
/** * @param string $name The name of this form element * @param string $options The available options * @param string $label The label text for this element (will be autoescaped) */ public function __construct($name, $options, $label = '') { parent::__construct('dropdown', $name, $label); $this->options($options); }
/** * @param string $id * @param array $htmlAttributes */ public function __construct($id, array $htmlAttributes = []) { parent::__construct('text', $id, $htmlAttributes); }
/** * @param string $id * @param string $group * @param array $value * @param array $htmlAttributes */ public function __construct($id, $group, $value, array $htmlAttributes) { parent::__construct('checkbox', $id, $htmlAttributes); $this->addAttributes(['name' => $group . '[' . $value . ']']); parent::setValue($value); }
/** * InputCheckboxElement constructor. * @param $name * @param null $value * @param array $attributes */ public function __construct($name, $value = null, array $attributes = []) { parent::__construct($name, $value, $attributes); $this->setAttribute('type', 'checkbox'); }
/** * @param string $type The type of this element * @param string $name The name of this form element * @param string $label The label text for this element */ public function __construct($type, $name, $label) { parent::__construct($type, $name, $label); // default value is 1 $this->attr('value', 1); }
/** * InputRangeElement constructor. * @param $name * @param int $min * @param int $max * @param int $step * @param null $value * @param array $attributes */ public function __construct($name, $min = 0, $max = 0, $step = 1, $value = null, array $attributes = []) { parent::__construct($name, $value, $attributes); $this->setAttributes(['type' => 'range', 'min' => (int) $min, 'max' => (int) $max, 'step' => (int) $step]); }
/** * InputButtonElement constructor. * @param null $value * @param array $attributes */ public function __construct($value = null, array $attributes = []) { parent::__construct(null, $value, $attributes); $this->setAttribute('type', 'button'); }
/** * @param string $id * @param array $htmlAttributes */ public function __construct($id, array $htmlAttributes) { parent::__construct('password', $id, $htmlAttributes); }
/** * @param string $id * @param array $htmlAttributes */ public function __construct($id, array $htmlAttributes) { parent::__construct('hidden', $id, $htmlAttributes); }
/** * @param string $id * @param string $group * @param array $value * @param array $htmlAttributes */ public function __construct($id, $group, $value, array $htmlAttributes) { parent::__construct('radio', $id, $htmlAttributes); $this->addAttributes(['name' => $group]); parent::setValue($value); }
/** * @param string $id * @param string $title * @param array $htmlAttributes */ public function __construct($id, $title, array $htmlAttributes = []) { parent::__construct('submit', $id, $htmlAttributes); $this->setValue($title); }