Class View
Core view: - static doctype storage - static storage for dir names with view scripts - possible to use for any controller/subcontroller/control/\MvcCore\Ext\Form - view prerender preparing and rendering - direct code evaluation - view helpers management - creating by predefined class names bases - instance storing and calling - views sub scripts relative path solving - Url() proxy method, AssetUrl() proxy method - magic calls: - __call() - helpers handling - __set() - to set anything in controller to get it back in view - __get() - to get anything in view previously completed in controller - no special view language implemented... why to use such stupid things...
Direct known subclasses
MvcCore\Ext\Form\Core\View
public static
|
|
public static
|
#
AddHelpersClassBases( )
Add view helpers class base name(s), example: \MvcCore\View::AddHelpersClassBases('\Any\Other\ViewHelpers\Place\', '...'); |
public static
string
|
#
GetViewScriptFullPath( string $typePath = '', string $corectedRelativePath = '' )
Get view script full path |
public
|
|
public
|
|
public
string
|
|
public
|
|
public
string
|
#
RenderScript( string $relativePath = '' )
Render controller/action template script and return it's result. |
public
string
|
|
public
string
|
#
RenderLayoutAndContent( string $relativePath = '', string $content = '' )
Render layout template script and return it's result with inner rendered content. |
public
string
|
|
public
string
|
|
public
string
|
#
Url( string $controllerActionOrRouteName = 'Index:Index', array $params = array() )
Generates url by: - 'Controller:Action' name and params array (for routes configuration when routes array has keys with 'Controller:Action' strings and routes has not controller name and action name defined inside) - route name and params array (route name is key in routes configuration array, should be any string but routes must have information about controller name and action name inside) Result address should have two forms: - nice rewrited url by routes configuration (for apps with .htaccess supporting url_rewrite and when first param is key in routes configuration array) - for all other cases is url form: index.php?controller=ctrlName&action=actionName (when first param is not founded in routes configuration array) |
public
string
|
|
public
|
|
public
string|mixed
|
#
__call( string $method, mixed $arguments )
Try to call view helper. If view helper doesn't exist in global helpers store - create new helper instance. If helper already exists in global helpers store - do not create it again - use instance from store. Then call it's public method named in the same way as helper and return result as it is without any conversion! So then there could be called any other helper method if helper instance was returned. |
string |
DOCTYPE_HTML4
View output document type HTML4 |
#
'HTML4'
|
string |
DOCTYPE_XHTML
View output document type XHTML |
#
'XHTML'
|
string |
DOCTYPE_HTML5
View output document type HTML5 |
#
'HTML5'
|
string |
EXTENSION
View script files extenion in Views application directory |
#
'.phtml'
|
public static
string
|
$Doctype
Document type (HTML, XHTML or anything you desire) |
#
self::DOCTYPE_HTML5
|
public static
string
|
$ScriptsDir
Controller action templates directory placed in '/App/Views' dir. For read & write. |
#
'Scripts'
|
public static
string
|
$HelpersDir
views helpers directory placed in '/App/Views' dir. For read & write. |
#
'Helpers'
|
public static
string
|
$LayoutsDir
Layout templates directory placed in '/App/Views' dir. For read & write. |
#
'Layouts'
|
public static
array
|
$HelpersClassBases
Helpers classes - base class names. For read & write. |
#
array(/*'\MvcCore\Ext\View\Helpers\'*/)
|
public
|
$Controller
Rendered content |
|
protected static
string
|
$originalyDeclaredProperties
Originaly declared dynamic properties to protect from __set() magic method |
#
array(
'Controller' => 1,
'_content' => 1,
'_renderedFullPaths'=> 1,
)
|