1545. Class

1545.1. Zend\View\Renderer\PhpRenderer

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.

1545.1.1. Methods

1545.1.1.1. __construct

__construct()

Constructor.

Parameters:array – Configuration key-value pairs.

1545.1.1.2. getEngine

getEngine()

Return the template engine object

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

Return type:PhpRenderer

1545.1.1.3. init

init()

Allow custom object initialization when extending Zend_View_Abstract or Zend_View

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

Return type:void

1545.1.1.4. setResolver

setResolver()

Set script resolver

Parameters:Resolver
Return type:PhpRenderer
Throws :ExceptionInvalidArgumentException

1545.1.1.5. resolver

resolver()

Retrieve template name or template resolver

Parameters:null|string
Return type:string|Resolver

1545.1.1.6. setVars

setVars()

Set variable storage

Expects either an array, or an object implementing ArrayAccess.

Parameters:array|ArrayAccess
Return type:PhpRenderer
Throws :ExceptionInvalidArgumentException

1545.1.1.7. vars

vars()

Get a single variable, or all variables

Parameters:mixed
Return type:mixed

1545.1.1.8. get

get()

Get a single variable

Parameters:mixed
Return type:mixed

1545.1.1.9. __get

__get()

Overloading: proxy to Variables container

Parameters:string
Return type:mixed

1545.1.1.10. __set

__set()

Overloading: proxy to Variables container

Parameters:
  • string
  • mixed
Return type:

void

1545.1.1.11. __isset

__isset()

Overloading: proxy to Variables container

Parameters:string
Return type:bool

1545.1.1.12. __unset

__unset()

Overloading: proxy to Variables container

Parameters:string
Return type:void

1545.1.1.13. setHelperPluginManager

setHelperPluginManager()

Set helper plugin manager instance

Parameters:string|HelperPluginManager
Return type:PhpRenderer
Throws :ExceptionInvalidArgumentException

1545.1.1.14. getHelperPluginManager

getHelperPluginManager()

Get helper plugin manager instance

Return type:HelperPluginManager

1545.1.1.15. plugin

plugin()

Get plugin instance

Parameters:
  • string – Name of plugin to return
  • null|array – Options to pass to plugin constructor (if not already instantiated)
Return type:

AbstractHelper

1545.1.1.16. __call

__call()

Overloading: proxy to helpers

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:
  • string
  • array
Return type:

mixed

1545.1.1.17. setFilterChain

setFilterChain()

Set filter chain

Parameters:FilterChain
Return type:PhpRenderer

1545.1.1.18. getFilterChain

getFilterChain()

Retrieve filter chain for post-filtering script content

Return type:FilterChain

1545.1.1.19. render

render()

Processes a view script and returns the output.

Parameters:
  • string|Model – Either the template to use, or a ViewModel. The ViewModel must have the template as an option in order to be valid.
  • null|array|Traversable – Values to use when rendering. If none provided, uses those in the composed variables container.
Return type:

string The script output.

Throws :

ExceptionDomainException if a ViewModel is passed, but does not contain a template option.

Throws :

ExceptionInvalidArgumentException if the values passed are not an array or ArrayAccess object

Throws :

ExceptionRuntimeException if the template cannot be rendered

1545.1.1.20. setCanRenderTrees

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.

Parameters:bool
Return type:PhpRenderer

1545.1.1.21. canRenderTrees

canRenderTrees()

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

Return type:bool

1545.1.1.22. addTemplate

addTemplate()

Add a template to the stack

Parameters:string
Return type:PhpRenderer

1545.1.1.23. __clone

__clone()

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

Return type:PhpRenderer