Class PhpRenderer

Summary

Fully Qualified Name: Zend\View\Renderer\PhpRenderer
Implements: RendererInterface, TreeRendererInterface

Description

Class for Zend\View\Strategy\PhpRendererStrategy to help enforce private constructs.

Note: all private variables in this class are prefixed with "__". This is to mark them as part of the internal implementation, and thus prevent conflict with variables injected into the renderer.

Convenience methods for build in helpers (@see __call):

Methods

Name Description Defined By
__call() Overloading: proxy to helpers PhpRenderer
__clone() Make sure View variables are cloned when the view is cloned. PhpRenderer
__construct() Constructor. PhpRenderer
__get() Overloading: proxy to Variables container PhpRenderer
__isset() Overloading: proxy to Variables container PhpRenderer
__set() Overloading: proxy to Variables container PhpRenderer
__unset() Overloading: proxy to Variables container PhpRenderer
addTemplate() Add a template to the stack PhpRenderer
canRenderTrees() Can we render trees, or are we configured to do so? PhpRenderer
get() Get a single variable PhpRenderer
getEngine() Return the template engine object PhpRenderer
getFilterChain() Retrieve filter chain for post-filtering script content PhpRenderer
getHelperPluginManager() Get helper plugin manager instance PhpRenderer
init() Allow custom object initialization when extending PhpRenderer PhpRenderer
plugin() Get plugin instance PhpRenderer
render() Processes a view script and returns the output. PhpRenderer
resolver() Retrieve template name or template resolver PhpRenderer
setCanRenderTrees() Set flag indicating whether or not we should render trees of view models PhpRenderer
setFilterChain() Set filter chain PhpRenderer
setHelperPluginManager() Set helper plugin manager instance PhpRenderer
setResolver() Set script resolver PhpRenderer
setVars() Set variable storage PhpRenderer
vars() Get a single variable, or all variables PhpRenderer

Method Details

__call()

Overloading: proxy to helpers

Proxies to the attached plugin manager to retrieve, return, and potentially execute helpers.

Parameter Name Type Description
$method string
$argv array

Returns: mixed

__clone()

Make sure View variables are cloned when the view is cloned.

Returns: \PhpRenderer

__construct()

Constructor.

Parameter Name Type Description
$config array Configuration

Returns:

__get()

Overloading: proxy to Variables container

Parameter Name Type Description
$name string

Returns: mixed

__isset()

Overloading: proxy to Variables container

Parameter Name Type Description
$name string

Returns: bool

__set()

Overloading: proxy to Variables container

Parameter Name Type Description
$name string
$value mixed

Returns: void

__unset()

Overloading: proxy to Variables container

Parameter Name Type Description
$name string

Returns: void

addTemplate()

Add a template to the stack

Parameter Name Type Description
$template string

Returns: \PhpRenderer

canRenderTrees()

Can we render trees, or are we configured to do so?

Returns: bool

get()

Get a single variable

Parameter Name Type Description
$key mixed

Returns: mixed

getEngine()

Return the template engine object

Returns the object instance, as it is its own template engine

Returns: \PhpRenderer

getFilterChain()

Retrieve filter chain for post-filtering script content

Returns: \FilterChain

getHelperPluginManager()

Get helper plugin manager instance

Returns: \HelperPluginManager

init()

Allow custom object initialization when extending PhpRenderer

Triggered by {@link __construct() the constructor} as its final action.

Returns: void

plugin()

Get plugin instance

Parameter Name Type Description
$name string Name
$options null|array Options

Returns: \AbstractHelper

render()

Processes a view script and returns the output.

Parameter Name Type Description
$nameOrModel string|\Model Either
$values null|array|\Traversable Values

Returns: string The script output.

resolver()

Retrieve template name or template resolver

Parameter Name Type Description
$name null|string

Returns: string|\Resolver

setCanRenderTrees()

Set flag indicating whether or not we should render trees of view models

If set to true, the View instance will not attempt to render children separately, but instead pass the root view model directly to the PhpRenderer. It is then up to the developer to render the children from within the view script.

Parameter Name Type Description
$renderTrees bool

Returns: \PhpRenderer

setFilterChain()

Set filter chain

Parameter Name Type Description
$filters \FilterChain

Returns: \PhpRenderer

setHelperPluginManager()

Set helper plugin manager instance

Parameter Name Type Description
$helpers string|\HelperPluginManager

Returns: \PhpRenderer

setResolver()

Set script resolver

Parameter Name Type Description
$resolver \Resolver

Returns: \PhpRenderer

setVars()

Set variable storage

Expects either an array, or an object implementing ArrayAccess.

Parameter Name Type Description
$variables array|\ArrayAccess

Returns: \PhpRenderer

vars()

Get a single variable, or all variables

Parameter Name Type Description
$key mixed

Returns: mixed

Top