Methods summary
public
string|null
|
#
GetId( )
Get form field HTML id attribute, completed from form name and field name.
This value is completed automatically, but you can customize it.
Get form field HTML id attribute, completed from form name and field name.
This value is completed automatically, but you can customize it.
Returns
string|null
|
public
string|null
|
#
GetName( )
Get form field specific name, used to identify submitted value.
This value is required for all form fields.
Get form field specific name, used to identify submitted value.
This value is required for all form fields.
Returns
string|null
|
public
string|null
|
#
GetType( )
Get form field type, used in <input type="..."> attribute value.
Every typed field has it's own string value, but base field type
\MvcCore\Ext\Forms\Field has NULL .
Get form field type, used in <input type="..."> attribute value.
Every typed field has it's own string value, but base field type
\MvcCore\Ext\Forms\Field has NULL .
Returns
string|null
|
public
string|array|integer|float|null
|
#
GetValue( )
Get form field value. It could be string or array, in or float, it depends
on field implementation. Default value is NULL .
Get form field value. It could be string or array, in or float, it depends
on field implementation. Default value is NULL .
Returns
string|array|integer|float|null
|
public
string[]
&
|
#
GetCssClasses( )
Get form field HTML element css classes strings as array.
Default value is an empty array to not render HTML class attribute.
Get form field HTML element css classes strings as array.
Default value is an empty array to not render HTML class attribute.
Returns
string[]
|
public
string|null
|
#
GetTitle( )
Get field title, global HTML attribute, optional.
Get field title, global HTML attribute, optional.
Returns
string|null
|
public
array
&
|
#
GetControlAttrs( )
Get collection with field HTML element
additional attributes by array keys/values.
There are no system attributes as: id , name ,
value , readonly , disabled , class ...
Those attributes have it's own configurable
properties with it's own getters.
HTML field elements are meant: <input>,
<button>, <select>, <textarea> ...
Default value is an empty array to not
render any additional attributes.
Get collection with field HTML element
additional attributes by array keys/values.
There are no system attributes as: id , name ,
value , readonly , disabled , class ...
Those attributes have it's own configurable
properties with it's own getters.
HTML field elements are meant: <input>,
<button>, <select>, <textarea> ...
Default value is an empty array to not
render any additional attributes.
Returns
array
|
public
mixed
|
#
GetControlAttr( string $name = 'data-*' )
Get field HTML element additional attribute
by attribute name and value.
There are no system attributes as: id , name ,
value , readonly , disabled , class ...
Those attributes have it's own configurable
properties with it's own getters.
HTML field elements are meant: <input>,
<button>, <select>, <textarea> ...
If attribute doesn't exist, NULL is returned.
Get field HTML element additional attribute
by attribute name and value.
There are no system attributes as: id , name ,
value , readonly , disabled , class ...
Those attributes have it's own configurable
properties with it's own getters.
HTML field elements are meant: <input>,
<button>, <select>, <textarea> ...
If attribute doesn't exist, NULL is returned.
Parameters
Returns
mixed
|
public
string[]|MvcCore\Ext\Forms\Validator[]
&
|
#
GetValidators( )
Get list of predefined validator classes ending names or validator instances.
Validator class must exist in any validators namespace(s) configured by default:
- array('\MvcCore\Ext\Forms\Validators\');
Or it could exist in any other validators namespaces, configured by method(s):
- \MvcCore\Ext\Form::AddValidatorsNamespaces(...);
- \MvcCore\Ext\Form::SetValidatorsNamespaces(...);
Every validator class (ending name) or validator instance has to
implement interface \MvcCore\Ext\Forms\IValidator or it could be extended
from base abstract validator class: \MvcCore\Ext\Forms\Validator .
Every typed field has it's own predefined validators, but you can define any
validator you want and replace them.
Get list of predefined validator classes ending names or validator instances.
Validator class must exist in any validators namespace(s) configured by default:
- array('\MvcCore\Ext\Forms\Validators\');
Or it could exist in any other validators namespaces, configured by method(s):
- \MvcCore\Ext\Form::AddValidatorsNamespaces(...);
- \MvcCore\Ext\Form::SetValidatorsNamespaces(...);
Every validator class (ending name) or validator instance has to
implement interface \MvcCore\Ext\Forms\IValidator or it could be extended
from base abstract validator class: \MvcCore\Ext\Forms\Validator .
Every typed field has it's own predefined validators, but you can define any
validator you want and replace them.
Returns
|
public
boolean
|
#
HasValidator( string|MvcCore\Ext\Forms\Validator $validatorNameOrInstance )
Get TRUE , if field has configured in it's validators array
given validator class ending name or validator instance.
Get TRUE , if field has configured in it's validators array
given validator class ending name or validator instance.
Parameters
Returns
boolean
|
public
boolean|string|null
|
#
GetViewScript( )
Get boolean TRUE or string with template relative path
without .phtml or .php extension to render
field by any custom template.
Get boolean TRUE or string with template relative path
without .phtml or .php extension to render
field by any custom template.
If TRUE , path to template is always completed by configured
\MvcCore\Ext\Forms\view::SetFieldsDir(...);
value, which is /App/Views/Forms/Fields by default.
If returned any string with relative path, path is always relative from configured
\MvcCore\Ext\Forms\view::SetFieldsDir(...); value, which is again
/App/Views/Forms/Fields by default.
FALSE or NULL (NULL is default) is returned to render field naturally.
Example:
// Render field template prepared in:
// '/App/Views/Forms/Fields/my-specials/my-field-type.phtml':
\MvcCore\Ext\Forms\View::GetFieldsDir(); // returned by default: 'Forms/Fields'
$field->GetViewScript(); // returned 'my-specials/my-field-type'
// Or the same by:
\MvcCore\Ext\Forms\View::GetFieldsDir(); // returned 'Forms/Fields/my-specials'
$field->GetType(); // returned 'my-field-type'
$field->GetViewScript(); // returned TRUE
Returns
boolean|string|null
|
public
string|null
|
#
GetJsClassName( )
Get supporting javascript full javascript class name.
If you want to use any custom supporting javascript prototyped class
for any additional purposes for your custom field, you need to use
$field->SetJsSupportingFile(...) to define path to your javascript file
relatively from configured \MvcCore\Ext\Form::SetJsSupportFilesRootDir(...);
value. Than you have to add supporting javascript file path into field form
in $field->PreDispatch(); method to render those files immediately after form
(once) or by any external custom assets renderer configured by:
$form->SetJsSupportFilesRenderer(...); method.
Or you can add your custom supporting javascript files into response by your
own and also you can run your helper javascripts also by your own. Is up to you.
NULL by default.
Get supporting javascript full javascript class name.
If you want to use any custom supporting javascript prototyped class
for any additional purposes for your custom field, you need to use
$field->SetJsSupportingFile(...) to define path to your javascript file
relatively from configured \MvcCore\Ext\Form::SetJsSupportFilesRootDir(...);
value. Than you have to add supporting javascript file path into field form
in $field->PreDispatch(); method to render those files immediately after form
(once) or by any external custom assets renderer configured by:
$form->SetJsSupportFilesRenderer(...); method.
Or you can add your custom supporting javascript files into response by your
own and also you can run your helper javascripts also by your own. Is up to you.
NULL by default.
Returns
string|null
|
public
string|null
|
#
GetJsSupportingFile( )
Get field supporting javascript file relative path.
If you want to use any custom supporting javascript file (with prototyped
class) for any additional purposes for your custom field, you need to
define path to your javascript file relatively from configured
\MvcCore\Ext\Form::SetJsSupportFilesRootDir(...); value.
Than you have to add supporting javascript file path into field form
in $field->PreDispatch(); method to render those files immediately after form
(once) or by any external custom assets renderer configured by:
$form->SetJsSupportFilesRenderer(...); method.
Or you can add your custom supporting javascript files into response by your
own and also you can run your helper javascripts also by your own. Is up to you.
NULL by default.
Get field supporting javascript file relative path.
If you want to use any custom supporting javascript file (with prototyped
class) for any additional purposes for your custom field, you need to
define path to your javascript file relatively from configured
\MvcCore\Ext\Form::SetJsSupportFilesRootDir(...); value.
Than you have to add supporting javascript file path into field form
in $field->PreDispatch(); method to render those files immediately after form
(once) or by any external custom assets renderer configured by:
$form->SetJsSupportFilesRenderer(...); method.
Or you can add your custom supporting javascript files into response by your
own and also you can run your helper javascripts also by your own. Is up to you.
NULL by default.
Returns
string|null
|
public
string|null
|
#
GetCssSupportingFile( )
Get field supporting css file relative path.
If you want to use any custom supporting css file
for any additional purposes for your custom field, you need to
define path to your css file relatively from configured
\MvcCore\Ext\Form::SetCssSupportFilesRootDir(...); value.
Than you have to add supporting css file path into field form
in $field->PreDispatch(); method to render those files immediately after form
(once) or by any external custom assets renderer configured by:
$form->SetCssSupportFilesRenderer(...); method.
Or you can add your custom supporting css files into response by your
own and also you can run your helper css also by your own. Is up to you.
NULL by default.
Get field supporting css file relative path.
If you want to use any custom supporting css file
for any additional purposes for your custom field, you need to
define path to your css file relatively from configured
\MvcCore\Ext\Form::SetCssSupportFilesRootDir(...); value.
Than you have to add supporting css file path into field form
in $field->PreDispatch(); method to render those files immediately after form
(once) or by any external custom assets renderer configured by:
$form->SetCssSupportFilesRenderer(...); method.
Or you can add your custom supporting css files into response by your
own and also you can run your helper css also by your own. Is up to you.
NULL by default.
Returns
string|null
|
public
|
#
GetTranslate( )
Get boolean flag about field visible texts and error messages translation.
This flag is automatically assigned from $field->form->GetTranslate();
flag in $field->Init(); method.
Get boolean flag about field visible texts and error messages translation.
This flag is automatically assigned from $field->form->GetTranslate();
flag in $field->Init(); method.
Var
bool
|
public static
array
&
|
#
GetTemplates( )
Get fields (and labels) default templates
for natural (not customized) field rendering.
Get fields (and labels) default templates
for natural (not customized) field rendering.
Returns
array
|