PHP Класс Zend\Mvc\View\Http\InjectTemplateListener

Наследование: extends Zend\EventManager\AbstractListenerAggregate
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$controllerMap array Array of controller namespace -> template mappings
$preferRouteMatchController boolean Flag to force the use of the route match controller param

Открытые методы

Метод Описание
attach ( Zend\EventManager\EventManagerInterface $events, $priority = 1 ) {@inheritDoc}
injectTemplate ( MvcEvent $e ) : void Inject a template into the view model, if none present
isPreferRouteMatchController ( ) : boolean
mapController ( string $controller ) : string | false Maps controller to template if controller namespace is whitelisted or mapped
setControllerMap ( array $map ) : self Set map of controller namespace -> template pairs
setPreferRouteMatchController ( boolean $preferRouteMatchController ) Sets the flag to instruct the listener to prefer the route match controller param over the class name

Защищенные методы

Метод Описание
deriveControllerClass ( string $controller ) : string Determine the name of the controller
inflectName ( string $name ) : string Inflect a name to a normalized value

Описание методов

attach() публичный Метод

{@inheritDoc}
public attach ( Zend\EventManager\EventManagerInterface $events, $priority = 1 )
$events Zend\EventManager\EventManagerInterface

deriveControllerClass() защищенный Метод

Strip the namespace, and the suffix "Controller" if present.
protected deriveControllerClass ( string $controller ) : string
$controller string
Результат string

inflectName() защищенный Метод

Inlines the logic from zend-filter's Word\CamelCaseToDash filter.
protected inflectName ( string $name ) : string
$name string
Результат string

injectTemplate() публичный Метод

Template is derived from the controller found in the route match, and, optionally, the action, if present.
public injectTemplate ( MvcEvent $e ) : void
$e Zend\Mvc\MvcEvent
Результат void

isPreferRouteMatchController() публичный Метод

public isPreferRouteMatchController ( ) : boolean
Результат boolean

mapController() публичный Метод

Maps controller to template if controller namespace is whitelisted or mapped
public mapController ( string $controller ) : string | false
$controller string controller FQCN
Результат string | false template name or false if controller was not matched

setControllerMap() публичный Метод

Set map of controller namespace -> template pairs
public setControllerMap ( array $map ) : self
$map array
Результат self

setPreferRouteMatchController() публичный Метод

Sets the flag to instruct the listener to prefer the route match controller param over the class name
public setPreferRouteMatchController ( boolean $preferRouteMatchController )
$preferRouteMatchController boolean

Описание свойств

$controllerMap защищенное свойство

Array of controller namespace -> template mappings
protected array $controllerMap
Результат array

$preferRouteMatchController защищенное свойство

Flag to force the use of the route match controller param
protected bool $preferRouteMatchController
Результат boolean