PHP Класс formHelper, nodejs-autorestart

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$checkboxes Cache containing individual radio or checkbox elements in an array
$radios Cache containing individual radio or checkbox elements in an array

Защищенные свойства (Protected)

Свойство Тип Описание
$_staticTypes array Form types that do not change value with user input

Открытые методы

Метод Описание
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

Защищенные методы

Метод Описание
_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

Описание методов

_getLabel() защищенный Метод

Adds label tags to a form element
protected _getLabel ( array $args, str $formElement ) : str
$args array
$formElement str
Результат str

_getProperties() защищенный Метод

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
Результат array

_indexDynamicArray() защищенный Метод

Converts dynamically-assigned array indecies to use an explicitely defined index
protected _indexDynamicArray ( string $name ) : string
$name string
Результат string

getCheckboxes() публичный Метод

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
Результат str

getErrorMessageContainer() публичный Метод

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
Результат string

getFormClose() публичный Метод

Closes a form if one is open
public getFormClose ( ) : string
Результат string

getFormOpen() публичный Метод

Begins a form Includes a safety mechanism to prevent re-opening an already-open form
public getFormOpen ( array $args = [] ) : string
$args array
Результат string

getInput() публичный Метод

Valid args are any properties valid within an HTML input as well as label
public getInput ( array $args ) : string
$args array
Результат string

getRadios() публичный Метод

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
Результат str

getSelect() публичный Метод

$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
Результат str

Описание свойств

$_staticTypes защищенное свойство

Form types that do not change value with user input
protected array $_staticTypes
Результат array

$checkboxes публичное свойство

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

$radios публичное свойство

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