Select
Select
Select
- Full name: \Gibbon\Forms\Input\Select
- Parent class: \Gibbon\Forms\Input\Input
Methods
- selected — Sets the selected element(s) of the select input.
- placeholder — Adds an initial entry to the select input. Required elements default to ‘Please select.
- selectAll — Set the selected element(s) to include all available options.
- selectMultiple — Sets the select input attribute to handle multiple selections.
- getLabelContext — Add extra help text to multi-select inputs.
- chainedTo — Provide an ID of another select input to chain the values in this input to the selected element of the first input.
- fromQueryChained — Build an internal options array from an SQL query with required value and name fields
Inherited from MultipleOptionsTrait
Inherited from Element
Inherited from Input
- setRow
- addValidationOption
- addValidation
- isValidatable
- hasValidation
- getValidationAsJSON
- getValidationOutput
Inherited from InputAttributesTrait
- setName
- getName
- setValue
- getValue
- loadFrom
- loadFromCSV
- setSize
- getSize
- isDisabled
- setDisabled
- getDisabled
- isRequired
- setRequired
- getRequired
- readonly
- setReadonly
- getReadonly
- setTabIndex
- getTabIndex
Inherited from Element
Inherited from BasicAttributesTrait
- setID
- getID
- setTitle
- getTitle
- setClass
- addClass
- removeClass
- getClass
- addData
- getData
- getAttributeString
selected
Sets the selected element(s) of the select input.
Select::selected( mixed $value ): self
Returns Self: This method can be chained.
placeholder
Adds an initial entry to the select input. Required elements default to ‘Please select.
Select::placeholder( string $value = '' ): self
..’
Returns Self: This method can be chained.
selectAll
Set the selected element(s) to include all available options.
Select::selectAll( ): self
Returns Self: This method can be chained.
selectMultiple
Sets the select input attribute to handle multiple selections.
Select::selectMultiple( boolean $value = true ): self
Returns Self: This method can be chained.
getLabelContext
Add extra help text to multi-select inputs.
Select::getLabelContext( $label ): string
Return Value:
string
chainedTo
Provide an ID of another select input to chain the values in this input to the selected element of the first input.
Select::chainedTo( string $id, array $values ): self
Chained values are paired with the options array, and correlate to the available options in the first select input.
Returns Self: This method can be chained.
fromQueryChained
Build an internal options array from an SQL query with required value and name fields
Select::fromQueryChained( \Gibbon\Contracts\Database\Connection $pdo, string $sql, array $data = array(), $chainedToID = false, $groupBy = false ): self
Returns Self: This method can be chained.