InputAttributesTrait
InputAttributesTrait
Basic HTML Input Attributes (name, type, value, required)
- Full name: \Gibbon\Forms\Traits\InputAttributesTrait
Methods
- setName — Set the input’s name attribute.
- getName — Gets the input’s name attribute.
- setValue — Set the input’s value.
- getValue — Gets the input’s value.
- loadFrom — Sets the input’s value if the name matches a key in the provided data set.
- loadFromCSV — Sets the input’s array value from a CSV string if the name matches a key in the provided data set.
- setSize — Set the input’s size attribute.
- getSize — Gets the input’s size attribute.
- isDisabled — Set the input to disabled.
- setDisabled — Set the input’s disabled attribute.
- getDisabled — Gets the input’s disabled attribute.
- isRequired — Set the input to required.
- setRequired — Set if the input is required.
- getRequired — Gets the input’s required attribute.
- readonly — Set the input to readonly.
- setReadonly — Set the input’s readonly attribute.
- getReadonly — Gets the input’s readonly attribute.
- setTabIndex — Set the input’s tabindex attribute.
- getTabIndex — Gets the input’s tabindex attribute.
setName
Set the input’s name attribute.
InputAttributesTrait::setName( string $name = '' ): self
Returns Self: This method can be chained.
getName
Gets the input’s name attribute.
InputAttributesTrait::getName( ): string
Return Value:
string
setValue
Set the input’s value.
InputAttributesTrait::setValue( string $value = '' ): self
Returns Self: This method can be chained.
getValue
Gets the input’s value.
InputAttributesTrait::getValue( ): mixed
Return Value:
mixed
loadFrom
Sets the input’s value if the name matches a key in the provided data set.
InputAttributesTrait::loadFrom( &$data )
loadFromCSV
Sets the input’s array value from a CSV string if the name matches a key in the provided data set.
InputAttributesTrait::loadFromCSV( &$data )
setSize
Set the input’s size attribute.
InputAttributesTrait::setSize( string|integer $size = '' ): self
Returns Self: This method can be chained.
getSize
Gets the input’s size attribute.
InputAttributesTrait::getSize( ): string|integer
Return Value:
string|integer
isDisabled
Set the input to disabled.
InputAttributesTrait::isDisabled( $disabled = true ): self
Returns Self: This method can be chained.
setDisabled
Set the input’s disabled attribute.
InputAttributesTrait::setDisabled( boolean $disabled ): self
Returns Self: This method can be chained.
getDisabled
Gets the input’s disabled attribute.
InputAttributesTrait::getDisabled( ): boolean
Return Value:
boolean
isRequired
Set the input to required.
InputAttributesTrait::isRequired( $required = true ): self
Returns Self: This method can be chained.
setRequired
Set if the input is required.
InputAttributesTrait::setRequired( boolean $required ): self
Returns Self: This method can be chained.
getRequired
Gets the input’s required attribute.
InputAttributesTrait::getRequired( ): boolean
Return Value:
boolean
readonly
Set the input to readonly.
InputAttributesTrait::readonly( boolean $value = true ): self
Returns Self: This method can be chained.
setReadonly
Set the input’s readonly attribute.
InputAttributesTrait::setReadonly( string $value ): self
Returns Self: This method can be chained.
getReadonly
Gets the input’s readonly attribute.
InputAttributesTrait::getReadonly( ): boolean
Return Value:
boolean
setTabIndex
Set the input’s tabindex attribute.
InputAttributesTrait::setTabIndex( string $value ): self
Returns Self: This method can be chained.
getTabIndex
Gets the input’s tabindex attribute.
InputAttributesTrait::getTabIndex( ): integer
Return Value:
integer