__construct()
createTemplateObject()
getDefaultOutputArray()
getDependencyHandler()
getNeedsContainer()
jsonEncodeForOutput()
preloadTemplate()
renderContainer()
renderError()
renderMessage()
renderRedirect()
renderSubView()
renderUnrepresentable()
renderView()
renderViewObject()
replaceRequiredExternalPlaceholders()
setNeedsContainer()
_addDefaultParams()
_preloadContainerData()
_stringifyObjectsInArray()
$_dependencies
$_needsContainer
$_request
$_response
Concrete renderer for JSON text/plain output.
This renderer is identical to the JSON renderer, except that it outputs a content-type header of 'text/plain' for those applications that require a plain text header rather than application/json, such as our inline file uploader.
package | XenForo_Mvc |
---|
__construct(\XenForo_Dependencies_Abstract $dependencies, \Zend_Controller_Response_Http $response, \Zend_Controller_Request_Http $request)
see | \global\XenForo_ViewRenderer_Abstract::__construct() |
---|
XenForo_Dependencies_Abstract
Zend_Controller_Response_Http
Zend_Controller_Request_Http
createTemplateObject(string $templateName, array $params) : \XenForo_Template_Abstract
Templates only represent HTML output, so no response type is needed. However, they can be used in any response type.
inherited_from | \XenForo_ViewRenderer_Abstract::createTemplateObject() |
---|---|
inherited_from | \XenForo_ViewRenderer_Json::createTemplateObject() |
string
Name of the template to create
array
Key-value parameters to pass to the template
getDefaultOutputArray(string $viewName, array $params, string $templateName) : array
inherited_from | \XenForo_ViewRenderer_Json::getDefaultOutputArray() |
---|
string
array
string
array
getDependencyHandler() : \XenForo_Dependencies_Abstract
inherited_from | \XenForo_ViewRenderer_Abstract::getDependencyHandler() |
---|---|
inherited_from | \XenForo_ViewRenderer_Json::getDependencyHandler() |
getNeedsContainer() : boolean
inherited_from | \XenForo_ViewRenderer_Abstract::getNeedsContainer() |
---|---|
inherited_from | \XenForo_ViewRenderer_Json::getNeedsContainer() |
boolean
jsonEncodeForOutput(mixed $input, $addDefaultParams) : string
This renders any objects with string representations to strings.
inherited_from | \XenForo_ViewRenderer_Json::jsonEncodeForOutput() |
---|
mixed
Data to JSON encode. Likely an array, but not always.
string
JSON encoded outputpreloadTemplate(string $templateName)
inherited_from | \XenForo_ViewRenderer_Abstract::preloadTemplate() |
---|---|
inherited_from | \XenForo_ViewRenderer_Json::preloadTemplate() |
string
Template name
renderContainer($contents, array $params) : string
This often represents the "chrome" of a page, including aspects like the header and footer. The content from the other render methods will generally be put inside this.
Note that not all response types will have a container. In which case, they should return the inner contents directly.
see | \global\XenForo_ViewRenderer_Abstract::renderContainer() |
---|---|
inherited_from | \XenForo_ViewRenderer_Json::renderContainer() |
string
array
string
renderError(string | array $error) : string
see | \global\XenForo_ViewRenderer_Abstract::renderError() |
---|---|
inherited_from | \XenForo_ViewRenderer_Json::renderError() |
string
array
Error message
string
JSON-encoded arrayrenderMessage(string $message) : string | false
see | \global\XenForo_ViewRenderer_Abstract::renderMessage() |
---|---|
inherited_from | \XenForo_ViewRenderer_Json::renderMessage() |
string
Text of the message to render
string
false
Rendered output. False if rendering wasn't possible (see {@link renderUnrepresentable()}).renderRedirect(integer $redirectType, string $redirectTarget, mixed $redirectMessage, array $redirectParams) : string
Most renderers will actually redirect, but some may not.
inherited_from | \XenForo_ViewRenderer_Json::renderRedirect() |
---|
integer
Type of redirect. See {@link XenForo_ControllerResponse_Redirect}
string
Target to redirect to
mixed
Redirect message
array
Redirect parameters
string
JSON-encoded arrayrenderSubView(\XenForo_ControllerResponse_View $subView) : string | \XenForo_Template_Abstract | false
inherited_from | \XenForo_ViewRenderer_Abstract::renderSubView() |
---|---|
inherited_from | \XenForo_ViewRenderer_Json::renderSubView() |
\XenForo_ControllerResponse_View
renderUnrepresentable() : string
Method is called when the concrete rendering function returns false or no concrete rendering function is available.
see | \global\XenForo_ViewRenderer_Abstract::renderUnrepresentable() |
---|---|
inherited_from | \XenForo_ViewRenderer_Json::renderUnrepresentable() |
string
JSON-encoded arrayrenderView(string $viewName, array $params, string $templateName, \XenForo_ControllerResponse_View $subView) : string | \XenForo_Template_Abstract | false
Should instantiate the view object and render it. Note that depending on response type, this class may have to manipulate the view name or instantiate a different object.
see | \global\XenForo_ViewRenderer_Abstract::renderView() |
---|---|
inherited_from | \XenForo_ViewRenderer_Json::renderView() |
string
Name of the view to create
array
Key-value array of parameters for the view.
string
Name of the template that will be used to display (may be ignored by view)
string
\XenForo_Template_Abstract
false
Rendered output. False if rendering wasn't possible (see {@link renderUnrepresentable()}).renderViewObject(string $class, string $responseType, array $params, string $templateName) : string | false | null
Returns null if no class can be loaded or no view method has been defined. Otherwise, the return is defined by the view render method, which should return either a string (rendered content) or false (unrepresentable).
inherited_from | \XenForo_ViewRenderer_Abstract::renderViewObject() |
---|---|
inherited_from | \XenForo_ViewRenderer_Json::renderViewObject() |
string
View class name
string
Response type (translated to method name as render$type)
array
Key-value parameters to pass to view. May be modified by the prepareParams call within.
string
Template name to pass to view (may be ignored by view)
string
false
null
replaceRequiredExternalPlaceholders(\XenForo_Template_Abstract $template, string $rendered) : string
This approach is needed to ensure that all requirements are properly included, even if they are included after the comment has been rendered.
inherited_from | \XenForo_ViewRenderer_Abstract::replaceRequiredExternalPlaceholders() |
---|---|
inherited_from | \XenForo_ViewRenderer_Json::replaceRequiredExternalPlaceholders() |
string
Already rendered output
string
setNeedsContainer(boolean $required) : boolean
inherited_from | \XenForo_ViewRenderer_Abstract::setNeedsContainer() |
---|---|
inherited_from | \XenForo_ViewRenderer_Json::setNeedsContainer() |
boolean
boolean
_addDefaultParams(array $params) : array
inherited_from | \XenForo_ViewRenderer_Json::_addDefaultParams() |
---|
array
array
_preloadContainerData()
Templates/phrases may be accidentally (or intentionally) rendered in the view or before the container is set to be rendered. Preloading data here can allow all the data to be fetched at once.
inherited_from | \XenForo_ViewRenderer_Abstract::_preloadContainerData() |
---|---|
inherited_from | \XenForo_ViewRenderer_Json::_preloadContainerData() |
_stringifyObjectsInArray(array $array) : array
inherited_from | \XenForo_ViewRenderer_Json::_stringifyObjectsInArray() |
---|
array
Array to search
array
Array with objects stringified$_dependencies : \XenForo_Dependencies_Abstract
inherited_from | \XenForo_ViewRenderer_Abstract::$$_dependencies |
---|---|
inherited_from | \XenForo_ViewRenderer_Json::$$_dependencies |
$_needsContainer : boolean
This may apply to an entire renderer or just individual render types.
inherited_from | \XenForo_ViewRenderer_Abstract::$$_needsContainer |
---|---|
inherited_from | \XenForo_ViewRenderer_Json::$$_needsContainer |
$_request : \Zend_Controller_Request_Http
Can be used to manipulate output based in input parameters AT YOUR OWN RISK. Strictly, making use of this breaks MVC principles, so avoid it if you can.
inherited_from | \XenForo_ViewRenderer_Abstract::$$_request |
---|---|
inherited_from | \XenForo_ViewRenderer_Json::$$_request |
$_response : \Zend_Controller_Response_Http
Generally should only be used to manipulate response codes if needed.
inherited_from | \XenForo_ViewRenderer_Abstract::$$_response |
---|---|
inherited_from | \XenForo_ViewRenderer_Json::$$_response |