PHP 클래스 Zend\Mvc\View\Http\InjectTemplateListener

상속: extends Zend\EventManager\AbstractListenerAggregate
파일 보기 프로젝트 열기: zendframework/zend-mvc 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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() 공개 메소드

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