Class Base
Direct known subclasses
MvcCore\Ext\Form\Core\ConfigurationIndirect known subclasses
MvcCore\Ext\Auth\SignInForm, MvcCore\Ext\Auth\SignOutForm, MvcCore\Ext\Auth\Virtual\Form, MvcCore\Ext\Form
protected
string
|
#
absolutizeAssetPath( string $path = '', string $assetsKey = '' )
Absolutize assets path. Every field has cofigured it's supporting css or js file with absolute path replacement inside file path string by 'MVCCORE_FORM_DIR'. Replace now the replacement by prepared properties $form->jsAssetsRootDir or $form->cssAssetsRootDir to set path into library assets folder by default or to any other user defined paths. |
protected
|
|
protected
array
|
#
completeAssets( string $assetsKey = '' )
Complete css or js supporting files to add after rendered form or to add them by external renderer. This function process all added assets and filter them to add them finally only one by once. |
protected
string
|
#
getRequestPath( )
Get request path with protocol, domain, port, part but without any possible query string. |
protected
|
#
prepareRenderIfNecessary( )
Prepare for rendering. - process all defined fields and call $field->setUp(); to prepare field for rendering process. - load any possible error from session and set up errors into fields and into form object to render them properly - load any possible previously submitted or stored data from session and set up form with them. - set initialized state to 2, which means - prepared for rendering |
protected
|
#
renderAssetFile( string & $content, callable & $renderer, boolean $loadContent, string $absPath )
Render supporting js/css file. Add it after renderer form content or call extenal renderer. |
protected
string|array
|
#
submitField( string $fieldName, array & $rawRequestParams,
Process single field configured validators and add errors where necessary. Clean client value to safe value by configured validator classes for this field. Return safe value. |
protected
|
#
submitFields( array $rawRequestParams = array() )
Process all fields configured validators and add errors where necessary. Clean client values to safe values by configured validator classes for each field. After all fields are processed, store clean values and error messages into session to use them in any possible future request, where is necessary to fill and submit the form again, for example by any error and redirecting to form error url. |
protected
integer
|
$initialized
Initialized state. You can call $form->Init(); method any time you want, it automaticly recognize, if it is already initialized or not, but there is necessary to call at Init() function begin parent::Init(); call to do it. Sometimes you need to work with feelds before rendering outside of form and there is necessary to call $form->Init() menthod by yourself, but normaly it's called internaly after it is realy needed, so only for render process and submit process. This initialization state property has three values: 0 - not initialized 1 - initialized, but fields are not prepared internaly for rendering 2 - all fieds are prepared for rendering (it is processed internaly in $form->Render() function, state 2 is not necessary to know. |
#
0
|
protected static
array
|
$js
Temporary collection of js files to add after form (directly into html output or by external renderer, doesn't metter), this serves only for purposes how to determinate to add supporting javascript by field type only once. Keys are relative javascript file paths and values are simple dummy booleans. |
#
array()
|
protected static
array
|
$css
Temporary collection of css files to add after form (directly into html output or by external renderer, doesn't metter), this serves only for purposes how to determinate to add supporting css by field type only once. Keys are relative css file paths and values are simple dummy booleans. |
#
array()
|
protected
string
|
$jsAssetsRootDir
Simple form javascript assets root directory. After \MvcCore\Ext\Form instance is created, this value is completed to library internal assets directory. If you want to create any custom field with custom javascript, you can do it by loading github package mvccore/simpleform-cusom-js somewhere create there any other custom javascript for any custom field and change this value to that directory. All supporting javascript for \MvcCore\Ext\Form fields will be loaded from there. |
#
''
|
protected
string
|
$cssAssetsRootDir
Simple form css assets root directory. After \MvcCore\Ext\Form instance is created, this value is completed to library internal assets directory. If you want to create any custom field with custom css, you can do it by creating an empty directory somewhere, by copying every css file from library assets directory into it, by creating any other custom css for any custom field and by change this value to that directory. All supporting css for \MvcCore\Ext\Form fields will be loaded from there. |
#
''
|
protected static
array
|
$csrfErrorHandlers
Collection with callable handlers to process anytime CSRF checking cause an error inside form. |
#
array()
|