Properties summary
protected
string|null
|
$id
Form field HTML id attribute, completed from form name and field name.
This value is completed automatically, but you can customize it.
Form field HTML id attribute, completed from form name and field name.
This value is completed automatically, but you can customize it.
|
|
protected
string|null
|
$name
Form field specific name, used to identify submitted value.
This value is required for all form fields.
Form field specific name, used to identify submitted value.
This value is required for all form fields.
Requires
|
|
protected
string|null
|
$type
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 .
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 .
|
|
protected
string|array|integer|float|null
|
$value
Form field value. It could be string or array, in or float, it depends
on field implementation. Default value is NULL .
Form field value. It could be string or array, in or float, it depends
on field implementation. Default value is NULL .
|
|
protected
string[]
|
$cssClasses
Form field HTML element css classes strings.
Default value is an empty array to not render HTML class attribute.
Form field HTML element css classes strings.
Default value is an empty array to not render HTML class attribute.
|
|
protected
string|null
|
$title
Field title, global HTML attribute, optional.
Field title, global HTML attribute, optional.
See
https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes#attr-title
|
|
protected
boolean
|
$translateTitle
Boolean to translate title text, TRUE by default.
Boolean to translate title text, TRUE by default.
|
|
protected
array
|
$controlAttrs
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 has 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.
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 has 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.
|
|
protected
string[]|MvcCore\Ext\Forms\Validator[]
|
$validators
List of predefined validator classes ending names or validator instances.
Keys are validators ending names and values are validators ending names or 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.
List of predefined validator classes ending names or validator instances.
Keys are validators ending names and values are validators ending names or 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.
|
|
protected
boolean|string|null
|
$viewScript
Boolean TRUE or string with template relative path
without .phtml or .php extension, if you want to render
field by any custom template.
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 , 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->viewScript = 'my-specials/my-field-type';
// Or you can do the same by:
\MvcCore\Ext\Forms\View::SetFieldsDir('Forms/Fields/my-specials');
$field->type = 'my-field-type';
|
|
protected
string|null
|
$jsClassName
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->jsSupportingFile property 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.
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->jsSupportingFile property 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.
|
|
protected
string|null
|
$jsSupportingFile
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.
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.
|
|
protected
string|null
|
$cssSupportingFile
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.
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.
|
|
protected
boolean|null
|
$translate
Boolean flag about field visible texts and error messages translation.
This flag is automatically assigned from $field->form->GetTranslate();
flag in $field->Init(); method.
Boolean flag about field visible texts and error messages translation.
This flag is automatically assigned from $field->form->GetTranslate();
flag in $field->Init(); method.
|
|
protected static
stdClass
|
$templates
Fields (and labels) default templates
for natural (not customized) field rendering.
Fields (and labels) default templates
for natural (not customized) field rendering.
|
#
[
'label' => '<label for="{id}"{attrs}>{label}</label>',
'control' => '<input id="{id}" name="{name}" type="{type}" value="{value}"{attrs} />',
'togetherLabelLeft' => '<label for="{id}"{attrs}><span>{label}</span>{control}</label>',
'togetherLabelRight'=> '<label for="{id}"{attrs}>{control}<span>{label}</span></label>',
]
|
protected
string[]
|
$errors
Internal array with errors for rendering.
Main errors collection is stored inside form instance.
Internal array with errors for rendering.
Main errors collection is stored inside form instance.
|
|
protected
MvcCore\Ext\Forms\View |MvcCore\Ext\Forms\IView
|
$view
Internal field view object, created for custom field rendering purposes,
if property $field->viewScript is TRUE or any string with relative template path.
Internal field view object, created for custom field rendering purposes,
if property $field->viewScript is TRUE or any string with relative template path.
|
|
protected
MvcCore\Ext\Form
|
$form
Internal reference to form instance, where current fields is added.
Internal reference to form instance, where current fields is added.
|
|
protected static
string[]
|
$declaredProtectedProperties
Protected properties, which is not possible
to configure through field constructor config array.
Protected properties, which is not possible
to configure through field constructor config array.
|
#
[
'view', 'form', 'translate', 'errors'
]
|