Methods summary
public
MvcCore\Ext\Forms\Field[]
&
|
#
GetFields( )
Get all form field controls.
After adding any field into form instance by $form->AddField() method
field is added under it's name into this array with all another form fields
except CSRF input:hidden s. Fields are rendered by order in this array.
Get all form field controls.
After adding any field into form instance by $form->AddField() method
field is added under it's name into this array with all another form fields
except CSRF input:hidden s. Fields are rendered by order in this array.
Returns
|
public
MvcCore\Ext\Form
|
#
SetFields( MvcCore\Ext\Forms\Field[] $fields = [] )
Replace all previously configured fields with given fully configured fields array.
This method is dangerous - it will remove all previously added form fields
and add given fields. If you want only to add another field(s) into form,
use functions:
- $form->AddField($field);
- $form->AddFields($field1, $field2, $field3...);
Replace all previously configured fields with given fully configured fields array.
This method is dangerous - it will remove all previously added form fields
and add given fields. If you want only to add another field(s) into form,
use functions:
- $form->AddField($field);
- $form->AddFields($field1, $field2, $field3...);
Parameters
- $fields
- Array with
\MvcCore\Ext\Forms\IField instances to set into form.
Returns
|
public
MvcCore\Ext\Form
|
#
AddFields( MvcCore\Ext\Forms\Field[] $fields )
Add multiple fully configured form field instances,
function have infinite params with new field instances.
Add multiple fully configured form field instances,
function have infinite params with new field instances.
Parameters
- $fields
- Any
\MvcCore\Ext\Forms\IField fully configured instance to add into form.
Returns
|
public
MvcCore\Ext\Form
|
|
public
boolean
|
#
HasField( MvcCore\Ext\Forms\Field |string $fieldOrFieldName = NULL )
If TRUE if given field instance or given
field name exists in form, FALSE otherwise.
If TRUE if given field instance or given
field name exists in form, FALSE otherwise.
Parameters
Returns
boolean
|
public
MvcCore\Ext\Form
|
#
RemoveField( MvcCore\Ext\Forms\Field |string $fieldOrFieldName = NULL )
Remove configured form field instance by given instance or given field name.
If field is not found by it's name, no error happened.
Remove configured form field instance by given instance or given field name.
If field is not found by it's name, no error happened.
Parameters
Returns
|
public
MvcCore\Ext\Forms\Field |null
|
#
GetField( string $fieldName = '' )
Return form field instance by form field name if it exists, else return null;
Return form field instance by form field name if it exists, else return null;
Parameters
Returns
|
public
MvcCore\Ext\Forms\Field[] |array
|
#
GetFieldsByType( string $fieldType = '' )
Return form field instances by given field type string.
If no field(s) found, it's returned empty array.
Result array is keyed by field names.
Return form field instances by given field type string.
If no field(s) found, it's returned empty array.
Result array is keyed by field names.
Parameters
Returns
|
public
MvcCore\Ext\Forms\Field |null
|
#
GetFirstFieldByType( string $fieldType = '' )
Return first caught form field instance by given field type string.
If no field found, NULL is returned.
Return first caught form field instance by given field type string.
If no field found, NULL is returned.
Parameters
Returns
|
public
MvcCore\Ext\Forms\Field[] |array
|
#
GetFieldsByPhpClass( string $fieldClassName = '', boolean $directTypesOnly = FALSE )
Return form field instances by field class name
compared by is_a($field, $fieldClassName) check.
If no field(s) found, it's returned empty array.
Result array is keyed by field names.
Return form field instances by field class name
compared by is_a($field, $fieldClassName) check.
If no field(s) found, it's returned empty array.
Result array is keyed by field names.
Parameters
- $fieldClassName
- Full php class name or full interface name.
- $directTypesOnly
- Get only instances created directly from called type, no instances extended from given class name.
Returns
|
public
MvcCore\Ext\Forms\Field |null
|
#
GetFirstFieldByPhpClass( string $fieldClassName = '', boolean $directTypesOnly = FALSE )
Return first caught form field instance by field class name
compared by is_a($field, $fieldClassName) check.
If no field found, it's returned NULL .
Return first caught form field instance by field class name
compared by is_a($field, $fieldClassName) check.
If no field found, it's returned NULL .
Parameters
- $fieldClassName
- Full php class name or full interface name.
- $directTypesOnly
- Get only instances created directly from called type, no instances extended from given class name.
Returns
|