/** * UIDropdown constructor. * @param array $dropdown_data The data (values and text) that should appear in the dropdown. * @param string $selected The value that the dropdown should show on page load * @param string $name The name of the input element- needed for submitting a form * @param string $on_change Javascript function to be run when the input is changed * @param bool $disabled True if this input should not be editable by the user * @param array $classes Classes for use with CSS and Javascript * @param string $id HTML ID Attribute */ public function __construct($dropdown_data = [], $selected = '', $name = '', $on_change = '', $disabled = false, $classes = [], $id = '') { parent::__construct('select', $selected, $name, $on_change, $disabled, $classes, $id); $this->dropdown_data = $dropdown_data; $this->addClass('form-control'); $this->addClass('input-sm'); }
/** * UITextBox constructor. * * @param string $type The type of input, i.e. text * @param string $value The value that the input should start with on page load * @param string $name The name of the input element- needed for submitting a form * @param string $placeholder A placeholder text string to be displayed in the text box * @param string $on_change Javascript function to be run when the input is changed * @param bool $disabled True if this input should not be editable by the user * @param array $classes Classes for use with CSS and Javascript * @param string $id HTML ID Attribute */ public function __construct($type = 'text', $value = '', $name = '', $placeholder = '', $on_change = '', $disabled = false, $classes = ['form-control'], $id = '') { parent::__construct($type, $value, $name, $on_change, $disabled, $classes, $id); $this->placeholder = $placeholder; }
/** * UICheckbox constructor. * * @param bool $selected Whether this checkbox is selected or not * @param string $name The name of the input element- needed for submitting a form * @param string $placeholder A placeholder text string to be displayed in the text box * @param bool $disabled True if this input should not be editable by the user * @param string $value The value that the input should start with on page load * @param string $id HTML ID Attribute */ public function __construct($selected = false, $name = '', $placeholder = '', $disabled = false, $value = '', $id = '') { parent::__construct('checkbox', $value, $name, $disabled, $id); }