Class to manage most of the flow of a request to a XenForo page.
This class: resolves a URL to a route, loads a specified controller, executes an action in that controller, loads the view, renders the view, and outputs the response.
Most dependent objects can be injected
| package | XenForo_Mvc |
|---|
__construct(\XenForo_Dependencies_Abstract $dependencies)
dispatch(\XenForo_RouteMatch $routeMatch) : \XenForo_ControllerResponse_Abstract | null
\XenForo_RouteMatch
\XenForo_ControllerResponse_AbstractnullNull will only occur if error handling is brokengetRequest() : \Zend_Controller_Request_Http
\Zend_Controller_Request_HttpgetResponse() : \Zend_Controller_Response_Http
\Zend_Controller_Response_HttprenderDebugOutput(string $originalContent) : string
Alternatively, it could inject itself into the view content.
stringOriginal, rendered view content
stringReplacement rendered view contentrenderView(\XenForo_ControllerResponse_Abstract $controllerResponse, \XenForo_ViewRenderer_Abstract $viewRenderer, array $containerParams) : string
\XenForo_ControllerResponse_AbstractController response object from last controller
arrayExtra container params (probably "sections" from routing)
stringView outputrun() : string | null
Primary method to be used by the external API.
stringnullReturns a string if {@link $_sendResponse} is falsesetRequest(\Zend_Controller_Request_Http $request)
\Zend_Controller_Request_Http
setRequestPaths()
setResponse(\Zend_Controller_Response_Http $response)
\Zend_Controller_Response_Http
setSendResponse(boolean $sendResponse)
boolean
setup()
showDebugOutput() : boolean
This usually depends on application configuration and a request param.
boolean_getErrorResponseFromException(\Exception $e) : \XenForo_ControllerResponse_Abstract
_getValidatedController(string $controllerName, string $action, \XenForo_RouteMatch $routeMatch) : \XenForo_Controller | null
stringName of the controller to load
stringName of the action to run
_getViewRenderer(string $responseType) : \XenForo_ViewRenderer_Abstract
stringResponse type (eg, html, xml, json)
_handleControllerResponse(mixed $controllerResponse, string $controllerName, string $action) : false | array
mixedExceptions will be thrown if is not {@link XenForo_ControllerResponse_Abstract}
stringName of the controller that generated this response
stringName of the action that generated this response
falsearrayFalse if no reroute is needed. Array with keys controllerName and action if needed._rerouteNotFound(string $controllerName, string $action) : array
stringController name
stringAction
arrayReroute array_rerouteServerError(\Exception $e) : array
$_dependencies : \XenForo_Dependencies_Abstract
$_request : \Zend_Controller_Request_Http
| see | \setRequest() |
|---|
$_response : \Zend_Controller_Response_Http
| see | \setResponse() |
|---|
$_sendResponse : boolean
If set to false, the response is returned instead.
| see | \setSendResponse() |
|---|