Methods summary
public static
MvcCore\Ext\Forms\Field
|
#
CreateInstance( array $cfg = [] )
Create new form control instance.
Create new form control instance.
Parameters
- $cfg
Config array with public properties and it's
values which you want to configure, presented
in camel case properties names syntax.
Returns
Throws
InvalidArgumentException
|
public
MvcCore\Ext\Forms\Field
|
#
SetForm( MvcCore\Ext\IForm $form )
This INTERNAL method is called from \MvcCore\Ext\Form after field
is added into form instance by $form->AddField(); method. Do not
use this method even if you don't develop any form field.
- Check if field has any name, which is required.
- Set up form and field id attribute by form id and field name.
- Set up required.
- Set up translate boolean property.
This INTERNAL method is called from \MvcCore\Ext\Form after field
is added into form instance by $form->AddField(); method. Do not
use this method even if you don't develop any form field.
- Check if field has any name, which is required.
- Set up form and field id attribute by form id and field name.
- Set up required.
- Set up translate boolean property.
Parameters
Returns
Throws
InvalidArgumentException
|
public
|
#
PreDispatch( )
This INTERNAL method is called from \MvcCore\Ext\Form just before
field is naturally rendered. It sets up field for rendering process.
Do not use this method even if you don't develop any form field.
- Set up field render mode if not defined.
- Translate label text if necessary.
This INTERNAL method is called from \MvcCore\Ext\Form just before
field is naturally rendered. It sets up field for rendering process.
Do not use this method even if you don't develop any form field.
- Set up field render mode if not defined.
- Translate label text if necessary.
|
public
string|integer|array|null
|
#
Submit( array & $rawRequestParams = [] )
This INTERNAL method is called from \MvcCore\Ext\Form
in submit processing. Do not use this method even if you
don't develop form library or any form field.
This INTERNAL method is called from \MvcCore\Ext\Form
in submit processing. Do not use this method even if you
don't develop form library or any form field.
Submit field value - process raw request value with all
configured validators and add errors into form if necessary.
Then return safe processed value by all from validators or NULL .
Parameters
- $rawRequestParams
Raw request params from MvcCore
request object based on raw app
input, $_GET or $_POST .
Returns
string|integer|array|null
|
public
array
&
|
#
GetValidatorData( array $fieldPropsDefaultValidValues = [] )
Default implementation for any extended field class to get field specific
data for validator purposes. If you want to extend any field, you could
implement this method better and faster. It's only necessary in your
implementation to return array with keys to be field specific properties
in camel case and values to be field properties values, which validator
requires.
Default implementation for any extended field class to get field specific
data for validator purposes. If you want to extend any field, you could
implement this method better and faster. It's only necessary in your
implementation to return array with keys to be field specific properties
in camel case and values to be field properties values, which validator
requires.
Parameters
- $fieldPropsDefaultValidValues
Returns
array
|
public
MvcCore\Ext\Forms\Field
|
#
AddValidationError( string $errorMsg = '', array $errorMsgArgs = [], callable $replacingCallable = NULL )
This INTERNAL method is called from \MvcCore\Ext\Forms\Field
in submit processing. Do not use this method even if you
don't develop any form field or field validator.
This INTERNAL method is called from \MvcCore\Ext\Forms\Field
in submit processing. Do not use this method even if you
don't develop any form field or field validator.
Add form error with given error message containing
possible replacements for array values.
If there is necessary to translate form elements
(form has configured property translator as callable )
than given error message is translated first before replacing.
Before error message processing for replacements,
there is automatically assigned into first position into $errorMsgArgs
array (translated) field label or field name and than
error message is processed for replacements.
If there is given some custom $replacingCallable param,
error message is processed for replacements by custom $replacingCallable .
If there is not given any custom $replacingCallable param,
error message is processed for replacements by static Format()
method by configured form view class.
Parameters
- $errorMsg
- $errorMsgArgs
- $replacingCallable
Returns
|
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 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
|
public
MvcCore\Ext\Forms\Field
|
#
SetId( string $id = NULL )
Set form field HTML id attribute, completed from form name and field name.
This value is completed automatically, but you can customize it.
Set form field HTML id attribute, completed from form name and field name.
This value is completed automatically, but you can customize it.
Parameters
Returns
|
public
MvcCore\Ext\Forms\Field
|
#
SetName( string $name = NULL )
Set form field specific name, used to identify submitted value.
This value is required for all form fields.
Set form field specific name, used to identify submitted value.
This value is required for all form fields.
Parameters
Returns
Requires
|
public
MvcCore\Ext\Forms\Field
|
#
SetType( string $type = NULL )
Set 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 .
Set 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 .
Parameters
Returns
|
public
MvcCore\Ext\Forms\Field
|
#
SetValue( string|array|integer|float|null $value )
Set form field value. It could be string or array, in or float, it depends
on field implementation. Default value is NULL .
Set form field value. It could be string or array, in or float, it depends
on field implementation. Default value is NULL .
Parameters
Returns
|
public
MvcCore\Ext\Forms\Field
|
#
SetCssClasses( string|string[] $cssClasses )
Set form field HTML element css classes strings.
All previously defined css classes will be removed.
Default value is an empty array to not render HTML class attribute.
You can define css classes as single string, more classes separated
by space or you can define css classes as array with strings.
Set form field HTML element css classes strings.
All previously defined css classes will be removed.
Default value is an empty array to not render HTML class attribute.
You can define css classes as single string, more classes separated
by space or you can define css classes as array with strings.
Parameters
Returns
|
public
MvcCore\Ext\Forms\Field
|
#
SetTitle( string|null $title, boolean|null $translateTitle = NULL )
Set field title, global HTML attribute, optional.
Set field title, global HTML attribute, optional.
Parameters
Returns
|
public
MvcCore\Ext\Forms\Field
|
#
AddCssClasses( string|string[] $cssClasses )
Add css classes strings for HTML element attribute class .
Given css classes will be added after previously defined css classes.
Default value is an empty array to not render HTML class attribute.
You can define css classes as single string, more classes separated
by space or you can define css classes as array with strings.
Add css classes strings for HTML element attribute class .
Given css classes will be added after previously defined css classes.
Default value is an empty array to not render HTML class attribute.
You can define css classes as single string, more classes separated
by space or you can define css classes as array with strings.
Parameters
Returns
|
public
MvcCore\Ext\Forms\Field
|
#
SetControlAttrs( array $attrs = [] )
Set collection with field HTML element
additional attributes by array keys/values.
Do not use system attributes as: id , name ,
value , readonly , disabled , class ...
Those attributes have it's own configurable properties
by setter methods or by constructor config array.
HTML field elements are meant: <input>,
<button>, <select>, <textarea> ...
Default value is an empty array to not
render any additional attributes.
All previously defined additional field attributes
will be replaced by given array.
Set collection with field HTML element
additional attributes by array keys/values.
Do not use system attributes as: id , name ,
value , readonly , disabled , class ...
Those attributes have it's own configurable properties
by setter methods or by constructor config array.
HTML field elements are meant: <input>,
<button>, <select>, <textarea> ...
Default value is an empty array to not
render any additional attributes.
All previously defined additional field attributes
will be replaced by given array.
Parameters
Returns
|
public
MvcCore\Ext\Forms\Field
|
#
SetControlAttr( string $name, mixed $value )
Set field HTML element additional attribute
by attribute name and value.
Do not use system attributes as: id , name ,
value , readonly , disabled , class ...
Those attributes have it's own configurable properties
by setter methods or by constructor config array.
HTML field elements are meant: <input>,
<button>, <select>, <textarea> ...
Given additional field attribute will be directly
set into additional attributes array and any
previous attribute with the same name will be overwritten.
Set field HTML element additional attribute
by attribute name and value.
Do not use system attributes as: id , name ,
value , readonly , disabled , class ...
Those attributes have it's own configurable properties
by setter methods or by constructor config array.
HTML field elements are meant: <input>,
<button>, <select>, <textarea> ...
Given additional field attribute will be directly
set into additional attributes array and any
previous attribute with the same name will be overwritten.
Parameters
Returns
|
public
MvcCore\Ext\Forms\Field
|
#
AddControlAttrs( array $attrs = [] )
Add (and merge) collection with field HTML element
additional attributes by array keys/values.
Do not use system attributes as: id , name ,
value , readonly , disabled , class ...
Those attributes have it's own configurable properties
by setter methods or by constructor config array.
HTML field elements are meant: <input>,
<button>, <select>, <textarea> ... .
All given additional field attributes
will be merged with previously defined attributes.
Add (and merge) collection with field HTML element
additional attributes by array keys/values.
Do not use system attributes as: id , name ,
value , readonly , disabled , class ...
Those attributes have it's own configurable properties
by setter methods or by constructor config array.
HTML field elements are meant: <input>,
<button>, <select>, <textarea> ... .
All given additional field attributes
will be merged with previously defined attributes.
Parameters
Returns
|
public
MvcCore\Ext\Forms\Field
|
#
SetValidators( array $validatorsNamesOrInstances = [] )
Set 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 given validator class (ending name) or given 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.
Set 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 given validator class (ending name) or given 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.
Parameters
- $validatorsNamesOrInstances
Returns
|
public
MvcCore\Ext\Forms\Field
|
#
AddValidators( string[]|MvcCore\Ext\Forms\Validator[] $validatorsNamesOrInstances = [] )
Add 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 given validator class (ending name) or given 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.
Add 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 given validator class (ending name) or given 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.
Parameters
- $validatorsNamesOrInstances
Returns
|
public
MvcCore\Ext\Forms\Field
|
#
RemoveValidator( string[]|MvcCore\Ext\Forms\Validator[] $validatorNameOrInstance )
Remove predefined validator by given class ending name or by given validator instance.
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 given validator class (ending name) or given 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.
Remove predefined validator by given class ending name or by given validator instance.
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 given validator class (ending name) or given 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.
Parameters
Returns
|
public
MvcCore\Ext\Forms\Field
|
#
SetViewScript( boolean|string|null $boolOrViewScriptPath = NULL )
Set boolean TRUE or string with template relative path
without .phtml or .php extension, if you want to render
field by any custom template.
Set boolean TRUE or string with template relative path
without .phtml or .php extension, if you want to render
field by any custom template.
If TRUE given, path to template
is completed by configured \MvcCore\Ext\Forms\view::SetFieldsDir(...);
value, which is /App/Views/Forms/Fields by default.
If any string with relative path given, path must be relative from configured
\MvcCore\Ext\Forms\view::SetFieldsDir(...); value, which is again
/App/Views/Forms/Fields by default.
To render field naturally, set FALSE , empty string or NULL (NULL is default).
Example:
// To render field template prepared in:
// '/App/Views/Forms/Fields/my-specials/my-field-type.phtml':
\MvcCore\Ext\Forms\View::SetFieldsDir('Forms/Fields'); // by default
$field->SetViewScript('my-specials/my-field-type');
// Or you can do the same by:
\MvcCore\Ext\Forms\View::SetFieldsDir('Forms/Fields/my-specials');
$field->SetType('my-field-type');
Parameters
Returns
|
public
MvcCore\Ext\Forms\Field
|
#
SetJsClassName( string $jsClassName )
Set 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.
Set 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.
Parameters
Returns
|
public
MvcCore\Ext\Forms\Field
|
#
SetJsSupportingFile( string $jsSupportingFilePath )
Set 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.
Set 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.
Parameters
- $jsSupportingFilePath
- $jsFullFile
Returns
|
public
MvcCore\Ext\Forms\Field
|
#
SetCssSupportingFile( string $cssSupportingFilePath )
Set 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.
Set 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.
Parameters
- $cssSupportingFilePath
- $cssFullFile
Returns
|
public
MvcCore\Ext\Forms\Field
|
#
SetTranslate( boolean $translate )
Set boolean flag about field visible texts and error messages translation.
This flag is automatically assigned from $field->form->GetTranslate();
flag in $field->Init(); method.
Set boolean flag about field visible texts and error messages translation.
This flag is automatically assigned from $field->form->GetTranslate();
flag in $field->Init(); method.
Parameters
Returns
|
public
MvcCore\Ext\Forms\Field
|
#
AddError( string $errorMsg )
Add field error message text to render it in rendering process.
This method is only for rendering purposes, not to add errors
into session. It's always called internally from \MvcCore\Ext\Form
in render preparing process. To add form error properly,
use $field->form->AddError($errorMsg, $fieldNames); method instead.
Add field error message text to render it in rendering process.
This method is only for rendering purposes, not to add errors
into session. It's always called internally from \MvcCore\Ext\Form
in render preparing process. To add form error properly,
use $field->form->AddError($errorMsg, $fieldNames); method instead.
Parameters
Returns
|
public static
string
|
#
SetTemplate( string $templateName = 'control', string $templateCode = '' )
Set field (or label) default template for natural
(not customized with *.phtml view) field rendering.
Set field (or label) default template for natural
(not customized with *.phtml view) field rendering.
Parameters
- $templateName
- Template name in array
static::$templates .
- $templateCode
- Template HTML code with prepared replacements.
Returns
string Newly configured template value.
|
public static
array
|
#
SetTemplates( array|stdClass $templates = [] )
Set fields (and labels) default templates for natural
(not customized with *.phtml view) field rendering.
Set fields (and labels) default templates for natural
(not customized with *.phtml view) field rendering.
Parameters
Returns
array
|
public
string
|
#
Render( )
Render field in full mode (with configured label), naturally or by custom template.
Render field in full mode (with configured label), naturally or by custom template.
Returns
string
|
public
string
|
#
RenderTemplate( )
This INTERNAL method is called from \MvcCore\Ext\Forms\Field\Rendering
in rendering process. Do not use this method even if you don't develop any form field.
This INTERNAL method is called from \MvcCore\Ext\Forms\Field\Rendering
in rendering process. Do not use this method even if you don't develop any form field.
Renders field by configured custom template property $field->viewScript .
This method creates $view = new \MvcCore\Ext\Form\Core\View(); ,
sets all local context variables into view instance and renders
configured view instance into result string.
Returns
string
|
public
string
|
#
RenderNaturally( )
This INTERNAL method is called from \MvcCore\Ext\Forms\Field\Rendering
in rendering process. Do not use this method even if you don't develop any form field.
This INTERNAL method is called from \MvcCore\Ext\Forms\Field\Rendering
in rendering process. Do not use this method even if you don't develop any form field.
Render field naturally by configured property $field->renderMode if any
or by default render mode without any label. Field should be rendered with
label beside, label around or without label by local field configuration.
Also there could be rendered specific field errors before or after field
if field form is configured in that way.
Returns
string
|
public
string
|
#
RenderLabelAndControl( )
This INTERNAL method is called from \MvcCore\Ext\Forms\Field\Rendering
in rendering process. Do not use this method even if you don't develop any form field.
This INTERNAL method is called from \MvcCore\Ext\Forms\Field\Rendering
in rendering process. Do not use this method even if you don't develop any form field.
Render field control and label by local configuration in left or in right side,
errors beside if form is configured to render specific errors beside controls.
Returns
string
|
public
string
|
#
RenderControlInsideLabel( )
This INTERNAL method is called from \MvcCore\Ext\Forms\Field\Rendering
in rendering process. Do not use this method even if you don't develop any form field.
This INTERNAL method is called from \MvcCore\Ext\Forms\Field\Rendering
in rendering process. Do not use this method even if you don't develop any form field.
Render field control inside label by local configuration, render field
errors beside if form is configured to render specific errors beside controls.
Returns
string
|
public
string
|
#
RenderControl( )
This INTERNAL method is called from \MvcCore\Ext\Forms\Field\Rendering
in rendering process. Do not use this method even if you don't develop any form field.
This INTERNAL method is called from \MvcCore\Ext\Forms\Field\Rendering
in rendering process. Do not use this method even if you don't develop any form field.
Render control tag only without label or specific errors.
Returns
string
|
public
string
|
#
RenderLabel( )
This INTERNAL method is called from \MvcCore\Ext\Forms\Field\Rendering
in rendering process. Do not use this method even if you don't develop any form field.
This INTERNAL method is called from \MvcCore\Ext\Forms\Field\Rendering
in rendering process. Do not use this method even if you don't develop any form field.
Render label tag only without control or specific errors.
Returns
string
|
public
string
|
#
RenderErrors( )
This INTERNAL method is called from \MvcCore\Ext\Forms\Field\Rendering
in rendering process. Do not use this method even if you don't develop any form field.
This INTERNAL method is called from \MvcCore\Ext\Forms\Field\Rendering
in rendering process. Do not use this method even if you don't develop any form field.
Render field specific errors only without control or label.
Returns
string
|