Input
Input implements ValidatableInterface, RowDependancyInterface
Abstract base class for form input elements.
- Full name: \Gibbon\Forms\Input\Input
- Parent class: \Gibbon\Forms\Layout\Element
- This class implements: Warning: strrchr() expects parameter 1 to be string, object given in /Users/sankuipe/Desktop/Localhost/documentor/src/Extension/TwigMarkdownAnchorLink.php on line 108
Methods
- __construct — Create an HTML form input.
- setRow — Method for RowDependancyInterface to automatically set a reference to the parent Row object.
- addValidationOption — Add a LiveValidation option to the javascript object (eg: onlyOnSubmit: true, onlyOnBlur: true)
- addValidation — Add a LiveValidation setting to this element by type (eg: Validate.Presence)
- isValidatable — Can this input be validated? Prevent LiveValidation for elements with no ID, and readonly inputs.
- hasValidation — An input has validation if it’s validatable and either required or has defined validations.
- getValidationAsJSON — Get a stringified json object of the current validations.
- getValidationOutput — Gets the HTML output for this form element.
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
__construct
Create an HTML form input.
Input::__construct( string $name )
setRow
Method for RowDependancyInterface to automatically set a reference to the parent Row object.
Input::setRow( object $row )
addValidationOption
Add a LiveValidation option to the javascript object (eg: onlyOnSubmit: true, onlyOnBlur: true)
Input::addValidationOption( string $option = '' )
addValidation
Add a LiveValidation setting to this element by type (eg: Validate.Presence)
Input::addValidation( string $type, string $params = '' )
isValidatable
Can this input be validated? Prevent LiveValidation for elements with no ID, and readonly inputs.
Input::isValidatable( ): boolean
Return Value:
boolean
hasValidation
An input has validation if it’s validatable and either required or has defined validations.
Input::hasValidation( ): boolean
Return Value:
boolean
getValidationAsJSON
Get a stringified json object of the current validations.
Input::getValidationAsJSON( ): string
Return Value:
string
getValidationOutput
Gets the HTML output for this form element.
Input::getValidationOutput( ): string
Return Value:
string