Class View
Responsibility: create and extended MvcCore view instance to render form or
form field with custom view template. This view contains built-in properties:
- view
- Containing parent controller view.
- form
- Containing rendered form instance when form or field is rendered.
- field
- Containing rendered field instance when field is rendered.
This view also contains many built-in methods to render specific form parts:
- RenderBegin()
- Renders opening <form>
tag with all configured attributes.
- RenderErrors()
- Renders translated form errors.
- RenderContent()
- Render all configured form fields from $this->form->GetFields()
array by calling Render()
method on every field instance.
- RenderEnd()
- Renders opening <form>
tag and configured form field's supporting js/css files.
- static Format()
- MvcCore\View implements MvcCore\IView uses MvcCore\View\Props, MvcCore\View\GettersSetters, MvcCore\View\Rendering, MvcCore\View\DirectoryMethods, MvcCore\View\MagicMethods, MvcCore\View\UrlHelpers, MvcCore\View\ViewHelpers, MvcCore\View\Escaping, MvcCore\View\LocalMethods
-
MvcCore\Ext\Forms\View
public static
string
|
#
GetFormsDir( )
Get global views forms directory placed by default
inside |
public static
string
|
#
SetFormsDir( string $formsDir = 'Forms' )
Set global views forms directory placed by default
inside |
public static
string
|
#
GetFieldsDir( )
Get global views fields directory placed by default
inside |
public static
string
|
#
SetFieldsDir( string $fieldsDir = 'Forms/Fields' )
Set global views fields directory placed by default
inside |
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
mixed
|
#
__get( string $name )
Get any value by given name existing in local store. If there is no value
in local store by given name, try to get result value into store by
field reflection class from field instance property if view is used for
field rendering. If there is still no value found, try to get result value
into store by form reflection class from form instance property and if
still no value found, try to get result value from local view instance
|
public
boolean
|
#
__isset( string $name )
Get |
public
mixed
|
|
public
string
|
|
public
string
|
#
RenderNaturally( )
Render form naturally by cycles inside php scripts. All form fields will be rendered inside empty < div> elements. |
public
string
|
|
public
string
|
#
RenderCsrf( )
Render hidden input with CSRF tokens.
This method is not necessary to call, it's
called internally by |
public
stdClass
|
|
public
string
|
#
RenderErrors( )
Render form errors.
If form is configured to render all errors together at form beginning,
this function completes all form errors into |
public
string
|
#
RenderContent( )
Render form content - form fields.
Go through all |
public
string
|
|
public static
string
|
|
public static
string
|
GetCurrentViewDirectory(),
GetCurrentViewFullPath(),
GetParentViewDirectory(),
GetParentViewFullPath()
|
__set(),
__unset(),
getReflectionClass()
|
AssetUrl(),
Url()
|
AddHelpersNamespaces(),
GetHelper(),
GetHelpersDir(),
SetHelper(),
SetHelpersDir(),
SetHelpersNamespaces()
|
Escape(),
EscapeAttr(),
EscapeCss(),
EscapeHtml(),
EscapeICal(),
EscapeJs(),
EscapeXml(),
escapeGetFlags()
|
correctRelativePath(),
initHelpersNamespaces(),
initViewScriptsFullPathBase()
|
Css(),
DataUrl(),
FormatDate(),
FormatMoney(),
FormatNumber(),
Js(),
LineBreaks(),
Truncate(),
WriteByJS()
|
protected
|
$form
Rendered form instance reference, which view belongs to. |
#
NULL
|
protected
|
$field
Rendered form field reference if view is not form's view. |
#
NULL
|
protected
|
$view
Controller view instance reference, which form belongs to. Every form is usually created inside MvcCore controller instance, and mostly every controller instance has it's own view. |
#
NULL
|
protected static
string
|
$formsDir
Global views forms directory placed by default
inside |
#
'Forms'
|
protected static
string
|
$fieldsDir
Global views fields directory placed by default
inside |
#
'Forms/Fields'
|
$__protected,
$_globalHelpers,
$_toolClass,
$_viewScriptsFullPathBase,
$controller,
$doctype,
$extension,
$helpersDir,
$helpersNamespaces,
$layoutsDir,
$scriptsDir
|