Overview

Namespaces

  • MvcCore
    • Ext
      • Auth
        • Virtual
      • Debug
        • Tracy
      • Form
        • Core
        • Validators
      • Request
      • Router
        • Lang
      • View
        • Helpers
  • None

Classes

  • Base
  • Configuration
  • Field
  • FieldGroup
  • Helpers
  • Validator
  • View

Exceptions

  • Exception
  • Overview
  • Namespace
  • Class
  • Tree

Class Base

Direct known subclasses

MvcCore\Ext\Form\Core\Configuration

Indirect known subclasses

MvcCore\Ext\Auth\SignInForm, MvcCore\Ext\Auth\SignOutForm, MvcCore\Ext\Auth\Virtual\Form, MvcCore\Ext\Form
Abstract
Namespace: MvcCore\Ext\Form\Core
Located at ext-form/src/MvcCore/Ext/Form/Core/Base.php
Methods summary
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.

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.

Parameters

$path
$assetsKey

Returns

string
protected MvcCore\Ext\Form|MvcCore\Ext\Form\Core\Base
# cleanUpRenderIfNecessary( )

Clean up after rendering. - clean session errors

Clean up after rendering. - clean session errors

Returns

MvcCore\Ext\Form|MvcCore\Ext\Form\Core\Base
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.

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.

Parameters

$assetsKey

Returns

array
protected string
# getRequestPath( )

Get request path with protocol, domain, port, part but without any possible query string.

Get request path with protocol, domain, port, part but without any possible query string.

Returns

string
protected MvcCore\Ext\Form|MvcCore\Ext\Form\Core\Base
# 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

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

Returns

MvcCore\Ext\Form|MvcCore\Ext\Form\Core\Base
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.

Render supporting js/css file. Add it after renderer form content or call extenal renderer.

Parameters

$content
$renderer
$loadContent
$absPath
protected string|array
# submitField( string $fieldName, array & $rawRequestParams, MvcCore\Ext\Form\Core\Field & $field )

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.

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.

Parameters

$fieldName
$rawRequestParams
$field

Returns

string|array
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.

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.

Parameters

$rawRequestParams
Properties summary
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.

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.

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.

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.

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.

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.

Collection with callable handlers to process anytime CSRF checking cause an error inside form.

# array()
MvcCore API documentation generated by ApiGen