PHP Class formHelper, nodejs-autorestart

Afficher le fichier Open project: shimondoodkin/nodejs-autorestart Class Usage Examples

Méthodes publiques

Свойство Type Description
$checkboxes Cache containing individual radio or checkbox elements in an array
$radios Cache containing individual radio or checkbox elements in an array

Protected Properties

Свойство Type Description
$_staticTypes array Form types that do not change value with user input

Méthodes publiques

Méthode Description
getCheckboxes ( array $args ) : str Returns a set of checkbox form elements
getErrorMessageContainer ( string $id, string $errorMessage = '' ) : string Returns a standardized container to wrap an error message
getFormClose ( ) : string Closes a form if one is open
getFormOpen ( array $args = [] ) : string Begins a form Includes a safety mechanism to prevent re-opening an already-open form
getInput ( array $args ) : string Used for text, textarea, hidden, password, file, button, image and submit
getRadios ( array $args ) : str Returns a set of radio form elements
getSelect ( array $args ) : str Returns a form select element

Méthodes protégées

Méthode Description
_getLabel ( array $args, str $formElement ) : str Adds label tags to a form element
_getProperties ( array $args, array $propertyNames = [] ) : array Sets the standard properties available to all input elements in addition to user-defined properties Standard properties are: name, value, class, style, id
_indexDynamicArray ( string $name ) : string Converts dynamically-assigned array indecies to use an explicitely defined index

Method Details

_getLabel() protected méthode

Adds label tags to a form element
protected _getLabel ( array $args, str $formElement ) : str
$args array
$formElement str
Résultat str

_getProperties() protected méthode

Sets the standard properties available to all input elements in addition to user-defined properties Standard properties are: name, value, class, style, id
protected _getProperties ( array $args, array $propertyNames = [] ) : array
$args array
$propertyNames array Optional, an array of user-defined properties
Résultat array

_indexDynamicArray() protected méthode

Converts dynamically-assigned array indecies to use an explicitely defined index
protected _indexDynamicArray ( string $name ) : string
$name string
Résultat string

getCheckboxes() public méthode

This method essentially extends the getRadios method and uses an identical signature except that $args['value'] can also accept an array of values to be checked.
public getCheckboxes ( array $args ) : str
$args array
Résultat str

getErrorMessageContainer() public méthode

Returns a standardized container to wrap an error message
public getErrorMessageContainer ( string $id, string $errorMessage = '' ) : string
$id string
$errorMessage string Optional, you may want to leave this blank and populate dynamically via JavaScript
Résultat string

getFormClose() public méthode

Closes a form if one is open
public getFormClose ( ) : string
Résultat string

getFormOpen() public méthode

Begins a form Includes a safety mechanism to prevent re-opening an already-open form
public getFormOpen ( array $args = [] ) : string
$args array
Résultat string

getInput() public méthode

Valid args are any properties valid within an HTML input as well as label
public getInput ( array $args ) : string
$args array
Résultat string

getRadios() public méthode

array( 'name' => '', 'value' => '', 'id' => '', 'legend' => '', 'options' => array('value1' => 'text1', 'value2' => 'text2', 'value3' => 'text3'), 'options' => array('text1', 'text2', 'text3'), //also acceptable (cannot do half this, half above syntax) )
public getRadios ( array $args ) : str
$args array
Résultat str

getSelect() public méthode

$args = array( 'name' => '', 'multiple' => true, 'leadingOptions' => array(), 'optgroups' => array('group 1' => array('label' => 'g1o1', 'value' => 'grp 1 opt 1'), 'group 2' => array(),), 'options' => array('value1' => 'text1', 'value2' => 'text2', 'value3' => 'text3'), 'value' => array('value2', 'value3') //if (multiple==false) 'value' => (str) 'value3' );
public getSelect ( array $args ) : str
$args array
Résultat str

Property Details

$_staticTypes protected_oe property

Form types that do not change value with user input
protected array $_staticTypes
Résultat array

$checkboxes public_oe property

Cache containing individual radio or checkbox elements in an array
public $checkboxes

$radios public_oe property

Cache containing individual radio or checkbox elements in an array
public $radios