Class Controller
Application controller: - template methods: (necessary to call parent at method begin) - Init() - called after controller is created - session start - all internal variables initialized except view - PreDispatch() - called after Init, before every controller action - view initialization - internal actions: - AssetAction() - handling internal MvcCore http request to get assets from packed package - url proxy method, reading request param proxy method - view rendering or no-rendering management - http responses and redirects management - basic error responses rendering - request termination (to write and close session)
Direct known subclasses
MvcCore\Ext\Auth\Virtual\ControllerIndirect known subclasses
MvcCore\Ext\Auth\Controller
public
|
#
__construct(
Create new controller instance - always called from \MvcCore app instance before controller is dispatched. Never used in application controllers. |
public
|
|
public
|
#
PreDispatch( )
Application pre render common action - always used in application controllers. This is best time to define any common properties or common view properties. |
public
string
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
string
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
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
|
#
RenderError( string $exceptionMessage = '' )
Render controller action for error or error plain text response. |
public
|
|
public
|
|
public static
|
protected
|
$request
Request object - parsed uri, query params, app paths... |
|
protected
|
$response
Response object - headers and rendered body |
|
protected
string
|
$controller
Requested controller name - dashed |
#
''
|
protected
string
|
$action
Requested action name - dashed |
#
''
|
protected
boolean
|
$ajax
Boolean about ajax request |
#
FALSE
|
protected
|
$view
Class store object for view properties |
#
NULL
|
protected
string
|
$layout
Layout name to render html wrapper around rendered view |
#
'layout'
|
protected
boolean
|
$viewEnabled
Boolean about disabled or enabled view to render at last |
#
TRUE
|
protected static
string
|
$staticPath
Path to all static files - css, js, imgs and fonts |
#
'/static'
|
protected static
string
|
$tmpPath
Path to temporary directory with generated css and js files |
#
'/Var/Tmp'
|