Class InjectTemplateListener

Summary

Fully Qualified Name: Zend\Mvc\View\Http\InjectTemplateListener
Extends: AbstractListenerAggregate

Description

Methods

Name Description Defined By
attach() {@inheritDoc} InjectTemplateListener
detach() {@inheritDoc} AbstractListenerAggregate
injectTemplate() Inject a template into the view model, if none present InjectTemplateListener
isPreferRouteMatchController() InjectTemplateListener
mapController() Maps controller to template if controller namespace is whitelisted or mapped InjectTemplateListener
setControllerMap() Set map of controller namespace -> template pairs InjectTemplateListener
setPreferRouteMatchController() Sets the flag to instruct the listener to prefer the route match controller param over the class name InjectTemplateListener

Method Details

attach()

{@inheritDoc}

Parameter Name Type Description
$events
$priority

Returns:

detach()

{@inheritDoc}

Parameter Name Type Description
$events

Returns:

injectTemplate()

Inject a template into the view model, if none present

Template is derived from the controller found in the route match, and, optionally, the action, if present.

Parameter Name Type Description
$e \MvcEvent

Returns: void

isPreferRouteMatchController()

Returns: bool

mapController()

Maps controller to template if controller namespace is whitelisted or mapped

Parameter Name Type Description
$controller string controller

Returns: string|bool template name or false if controller was not matched

setControllerMap()

Set map of controller namespace -> template pairs

Parameter Name Type Description
$map array

Returns: self

setPreferRouteMatchController()

Sets the flag to instruct the listener to prefer the route match controller param over the class name

Parameter Name Type Description
$preferRouteMatchController bool

Returns:

Top