Abstract class for Zend_View 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.

category Zend
package Zend_View

 Methods

Overloading: proxy to helpers

__call(string $method, array $argv) : mixed

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

  • If the helper does not define __invoke, it will be returned
  • If the helper does define __invoke, it will be called as a functor

Parameters

$method

string

$argv

array

Returns

mixed

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

__clone() : \Zend\View\Renderer\PhpRenderer

Constructor.

__construct(array $config) 

todo handle passing helper plugin manager, options
todo handle passing filter chain, options
todo handle passing variables object, options
todo handle passing resolver object, options

Parameters

$config

array

Configuration key-value pairs.

Overloading: proxy to Variables container

__get(string $name) : mixed

Parameters

$name

string

Returns

mixed

Overloading: proxy to Variables container

__isset(string $name) : bool

Parameters

$name

string

Returns

bool

Overloading: proxy to Variables container

__set(string $name, mixed $value) : void

Parameters

$name

string

$value

mixed

Overloading: proxy to Variables container

__unset(string $name) : void

Parameters

$name

string

Add a template to the stack

addTemplate(string $template) : \Zend\View\Renderer\PhpRenderer

Parameters

$template

string

Returns

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

canRenderTrees() : bool

Returns

bool

Get a single variable

get(mixed $key) : mixed

Parameters

$key

mixed

Returns

mixed

Return the template engine object

getEngine() : \Zend\View\Renderer\PhpRenderer

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

Returns

Retrieve filter chain for post-filtering script content

getFilterChain() : \Zend\Filter\FilterChain

Get helper plugin manager instance

getHelperPluginManager() : \Zend\View\HelperPluginManager

Allow custom object initialization when extending Zend_View_Abstract or Zend_View

init() : void

Triggered by the constructor as its final action.

Get plugin instance

plugin(string $name, array $options) : \Zend\View\Helper\AbstractHelper

Parameters

$name

string

Name of plugin to return

$options

nullarray

Options to pass to plugin constructor (if not already instantiated)

Returns

Processes a view script and returns the output.

render(string | \Zend\View\Model\ModelInterface $nameOrModel, null | array | \Traversable $values) : string

Parameters

$nameOrModel

string\Zend\View\Model\ModelInterface

Either the template to use, or a ViewModel. The ViewModel must have the template as an option in order to be valid.

$values

nullarray\Traversable

Values to use when rendering. If none provided, uses those in the composed variables container.

Exceptions

\Zend\View\Exception\DomainException if a ViewModel is passed, but does not contain a template option.
\Zend\View\Exception\InvalidArgumentException if the values passed are not an array or ArrayAccess object
\Zend\View\Exception\RuntimeException if the template cannot be rendered

Returns

stringThe script output.

Retrieve template name or template resolver

resolver(null | string $name) : string | \Zend\View\Resolver\ResolverInterface

Parameters

$name

nullstring

Returns

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

setCanRenderTrees(bool $renderTrees) : \Zend\View\Renderer\PhpRenderer

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.

Parameters

$renderTrees

bool

Returns

Set filter chain

setFilterChain(\Zend\Filter\FilterChain $filters) : \Zend\View\Renderer\PhpRenderer

Set helper plugin manager instance

setHelperPluginManager(string | \Zend\View\HelperPluginManager $helpers) : \Zend\View\Renderer\PhpRenderer

Set script resolver

setResolver(\Zend\View\Resolver\ResolverInterface $resolver) : \Zend\View\Renderer\PhpRenderer

Set variable storage

setVars(array | \ArrayAccess $variables) : \Zend\View\Renderer\PhpRenderer

Expects either an array, or an object implementing ArrayAccess.

Parameters

$variables

array\ArrayAccess

Exceptions

\Zend\View\Exception\InvalidArgumentException

Returns

Get a single variable, or all variables

vars(mixed $key) : mixed

Parameters

$key

mixed

Returns

mixed

 Properties

 

<p>Rendered content</p>

$__content : string

 

Script file name to execute

$__file : string

 

$__filterChain

$__filterChain : \Zend\Filter\FilterChain

 

Helper plugin manager

$__helpers : \Zend\View\HelperPluginManager

 

<p>Cache for the plugin call</p>

$__pluginCache : array

 

<p>Whether or not to render trees of view models</p>

$__renderTrees : bool

 

Template being rendered

$__template : null | string

 

Template resolver

$__templateResolver : \Zend\View\Resolver\ResolverInterface

 

Queue of templates to render

$__templates : array

 

<p>ArrayAccess or associative array representing available variables</p>

$__vars : \ArrayAccess | array

 

<p>Temporary variable stack; used when variables passed to render()</p>

$__varsCache : array