namespace \webfiori\ui
class Input
Class Attributes Summary
Class Methods Summary
Class Attributes Details
- none
- text
- decimal
- numeric
- tel
- search
- url
- text
- date
- password
- submit
- checkbox
- url
- tel
- color
- file
- range
- month
- number
- date-local
- hidden
- time
- week
- search
- select
- textarea
- radio
Class Methods Details
Parameters:
- string $type The type of the input element. If the given type is not in the array Input::INPUT_TYPES, 'text' will be used by default.
Parameters:
- HTMLNode|string $node The node that will be added. If a text is given and the node is of type <textarea>, The text will be added to the body of the text area. If input type is <select>, then new option will be added with the same label of the given text.
- array|boolean $attrs An optional array of attributes which will be set in the newly added child. Also, this argument can work as last method argument if a boolean is given.
- boolean $chainOnParent If this parameter is set to true, the method will return the same instance at which the child node is added to. If set to false, the method will return the child which have been added. This can be useful if the developer would like to add a chain of elements to the body of the node. Default value is true.
$useChaining
is set to true, the method will return the '$this' instance. If set to false, it will return the newly added child. If no child is added, the method will return null.Parameters:
- array $options An associative array that contains select options. The array must have at least the following indices:
- label: A label that will be displayed to the user.
- value: The value that will be set for the attribute 'value'.
- attributes: An associative array of attributes which can be set for the option.
Parameters:
- array $arrayOfOpt An associative array of options. The key will act as the 'value' attribute and the value of the key will act as the label for the option. Also, it is possible that the value of the key is a sub-associative array that contains only two indices:
- label: A label for the option.
- attributes: An optional associative array of attributes for the option. The key will act as the attribute name and the value of the key will act as the value of the attribute.
Parameters:
- array $optionsGroupArr An associative array that contains group info. The array must have the following indices:
- label: The label of the group.
- attributes: An optional associative array that contains group attributes.
- options: A sub associative array that contains group options. The key will act as the 'value' attribute and the value of the key will act as the label for the option. Also, it is possible that the value of the key is a sub-associative array that contains only two indices:
- label: A label for the option.
- attributes: An optional associative array of attributes. The key will act as the attribute name and the value of the key will act as the value of the attribute.
Parameters:
- string $mode The value to set. It must be a value from the array Input::INPUT_MODES.
Parameters:
- string $listId The ID of the element that will be acting as pre-defined list of elements. It cannot be set for hidden, file, checkbox, textarea, select and radio input types.
Parameters:
- string $max The value to set.
Parameters:
- string $length The value to set. The attribute value can be set only for text, email, search, tel and url input types.
Parameters:
- string $min The value to set.
Parameters:
- string $length The value to set. The attribute value can be set only for text, email, search, tel and url input types.
Parameters:
- string $name
Sets a placeholder text for the input element if it supports it. A placeholder can be set for the following input types:
- text
- textarea
- password
- number
- search
- url
Parameters:
Parameters:
- string $type The type of the input element. If the given type is not in the array Input::INPUT_TYPES, The method will not update the type. It can be only a value from the array Input::INPUT_TYPES. Also, if the input type is 'textarea' or 'select', this attribute will never be set using this method.
Parameters:
- string $text The value to set.