Concrete renderer for HTML output for an admin page.

Handles rendering of different types of controller responses.

package XenForo_Mvc

 Methods

Constructor

__construct(\XenForo_Dependencies_Abstract $dependencies, \Zend_Controller_Response_Http $response, \Zend_Controller_Request_Http $request) 
see \XenForo_ViewRenderer_Abstract::__construct()

Parameters

$response

\Zend_Controller_Response_Http

$request

\Zend_Controller_Request_Http

Helper method to create a template object for rendering.

createTemplateObject(string $templateName, array $params) : \XenForo_Template_Abstract
Inherited

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()

Parameters

$templateName

string

Name of the template to create

$params

array

Key-value parameters to pass to the template

Returns

Gets the dependencies handler object.

getDependencyHandler() : \XenForo_Dependencies_Abstract
Inherited
inherited_from \XenForo_ViewRenderer_Abstract::getDependencyHandler()

Returns

Gets the 'needs container' setting.

getNeedsContainer() : boolean
Inherited
inherited_from \XenForo_ViewRenderer_Abstract::getNeedsContainer()

Returns

boolean

Preloads a template with the template handler for use later.

preloadTemplate(string $templateName) 
Inherited
inherited_from \XenForo_ViewRenderer_Abstract::preloadTemplate()

Parameters

$templateName

string

Template name

Renders the container.

renderContainer(string $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 \XenForo_ViewRenderer_Abstract::renderContainer()

Parameters

$contents

string

$params

array

Returns

string

Renders an error.

renderError(string $error) : string | false
see \XenForo_ViewRenderer_Abstract::renderError()

Parameters

$error

string

Returns

stringfalse

Renders a message.

renderMessage(string $message) : string | false
see \XenForo_ViewRenderer_Abstract::renderMessage()

Parameters

$message

string

Text of the message to render

Returns

stringfalseRendered output. False if rendering wasn't possible (see {@link renderUnrepresentable()}).

Renders a redirect.

renderRedirect(integer $redirectType, string $redirectTarget, mixed $redirectMessage, array $redirectParams) : string
Inherited

Most renderers will actually redirect, but some may not.

inherited_from \XenForo_ViewRenderer_Abstract::renderRedirect()

Parameters

$redirectType

integer

Type of redirect. See {@link XenForo_ControllerResponse_Redirect}

$redirectTarget

string

Target to redirect to

$redirectMessage

mixed

Redirect message (unused by some redirect methods)

$redirectParams

array

Extra redirect parameters (unused by HTML)

Returns

stringEmpty string (nothing to display)

Renders a sub or child view.

renderSubView(\XenForo_ControllerResponse_View $subView) : string | \XenForo_Template_Abstract | false
Inherited
inherited_from \XenForo_ViewRenderer_Abstract::renderSubView()

Parameters

Returns

Fallback for rendering an "unrepresentable" message.

renderUnrepresentable() : string

Method is called when the concrete rendering function returns false or no concrete rendering function is available.

see \XenForo_ViewRenderer_Abstract::renderUnrepresentable()

Returns

string

Renders a view.

renderView(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 \XenForo_ViewRenderer_Abstract::renderView()

Parameters

$viewName

string

Name of the view to create

$params

array

Key-value array of parameters for the view.

$templateName

string

Name of the template that will be used to display (may be ignored by view)

$subView

\XenForo_ControllerResponse_Viewnull

A sub-view that will be rendered internal to this view

Returns

string\XenForo_Template_AbstractfalseRendered output. False if rendering wasn't possible (see {@link renderUnrepresentable()}).

General helper method to create and render a view object for the specified response type.

renderViewObject(string $class, string $responseType, array $params, string $templateName) : string | false | null
Inherited

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()

Parameters

$class

string

View class name

$responseType

string

Response type (translated to method name as render$type)

$params

array

Key-value parameters to pass to view. May be modified by the prepareParams call within.

$templateName

string

Template name to pass to view (may be ignored by view)

Returns

stringfalsenull

Replaces the place holders for required externals with the actual requirements.

replaceRequiredExternalPlaceholders(\XenForo_Template_Abstract $template, string $rendered) : string
Inherited

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()

Parameters

$template

\XenForo_Template_Abstract

The container template object; used to get the requirements

$rendered

string

Already rendered output

Returns

string

Sets the 'needs container' setting

setNeedsContainer(boolean $required) : boolean
Inherited
inherited_from \XenForo_ViewRenderer_Abstract::setNeedsContainer()

Parameters

$required

boolean

Returns

boolean

Data that should be preloaded for the container.

_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.

_renderSideNav()

_renderSideNav($root, array $sideLinks) 

Parameters

$root

$sideLinks

 Properties

 

$_dependencies : \XenForo_Dependencies_Abstract
Inherited
inherited_from \XenForo_ViewRenderer_Abstract::$$_dependencies
 

$_needsContainer : boolean
Inherited

This may apply to an entire renderer or just individual render types.

inherited_from \XenForo_ViewRenderer_Abstract::$$_needsContainer
 

$_request : \Zend_Controller_Request_Http
Inherited

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
 

$_response : \Zend_Controller_Response_Http
Inherited

Generally should only be used to manipulate response codes if needed.

inherited_from \XenForo_ViewRenderer_Abstract::$$_response