$name
$name : string
The name of the Easy Inputs instance.
Unless otherwise specified, this will also be the ID of any output form element.
A class that defines an HTML form.
An instance of class Form is created with every instance of EasyInputs. Regardless of whether we create form tags, the Form class holds all the relevant form information to which any Input class will need to refer.
This class also becomes the user's primary point of entry for creating new HTML form elements.
fieldsetOpen(array $args) : string
Creates a fieldset opening tag with optional legend
The legend key of the $args array is identical to the legend() function. The attrs array contains the same array of HTML attributes as always.
array | $args | 'attrs' array and optional legend info |
HTML containing the opening tag for a fieldset with optional legend.
label(string $for = null, string $text = null, array $attrs = null) : string
Create an HTML label
string | $for | The ID of the input this label is for. |
string | $text | Optional. Label text. The ID will be used if this value is left empty. |
array | $attrs | HTML attributes. |
The HTML string for this label.
input(string $name, array $args = array()) : string
Create an input.
This function creates an instance of Input, supplying it all the required arguments. Input will return
string | $name | The name of the input element. Note that this is not the HTML "name" attribute, but does get used to create it. If grouping is requested, this argument will be rolled into the combined HTML name of the group. |
array | $args | The args. |
The HTML string for this input.
inputs(array $inputs = array(), array $args = array()) : string
Display a group of inputs
Defines a group of inputs, both logically and physically. Logically, this group is associated with a single nonce to which it is bound. Physically, all elements of a group will be displayed together, in a fieldset, if requested.
array | $inputs | Array of input arrays. Formatted with the name of the input as the key and the $args as the content. |
array | $args | Arguments meant to be applied to either all inputs or to the container element. |
A string of HTML including all inputs from $inputs.
attrsToString(array $attrs) : string
Convert HTML attributes Passed an indexed array of attribute/value pairs, this function will return them as valid HTML attributes in a string.
array | $attrs | An array of HTML-compatible attribute/value pairs. |
The attributes as a string.
doAttributes(array $attribs) : array
Check the passed set of attributes against a list of supported types.
Checks for the existence of a given attribute in our supported list, and also checks it against a basic regex to be sure the value is also supported.
array | $attribs | The passed options. |
A sanitized array of HTML attributes
__call(string $name, array $settings) : string
Call the correct function if it exists.
This function allows us to call Input types directly at the discretion of the developer.
string | $name | The function requested. |
array | $settings | An optional array of arguments. |
Either an error message or the HTML element.