1014. Class

1014.1. Zend\Mvc\View\Http\ViewManager

Prepares the view layer

Instantiates and configures all classes related to the view layer, including the renderer (and its associated resolver(s) and helper manager), the view object (and its associated rendering strategies), and the various MVC strategies and listeners.

Defines and manages the following services:

  • ViewHelperManager (also aliased to ZendViewHelperPluginManager)
  • ViewTemplateMapResolver (also aliased to ZendViewResolverTemplateMapResolver)
  • ViewTemplatePathStack (also aliased to ZendViewResolverTemplatePathStack)
  • ViewResolver (also aliased to ZendViewResolverAggregateResolver and ResolverInterface)
  • ViewRenderer (also aliased to ZendViewRendererPhpRenderer and RendererInterface)
  • ViewPhpRendererStrategy (also aliased to ZendViewStrategyPhpRendererStrategy)
  • View (also aliased to ZendViewView)
  • DefaultRenderingStrategy (also aliased to ZendMvcViewHttpDefaultRenderingStrategy)
  • ExceptionStrategy (also aliased to ZendMvcViewHttpExceptionStrategy)
  • RouteNotFoundStrategy (also aliased to ZendMvcViewHttpRouteNotFoundStrategy and 404Strategy)
  • ViewModel

1014.1.1. Methods

1014.1.1.1. attach

attach()

Attach the aggregate to the specified event manager

Parameters:EventManagerInterface
Return type:void

1014.1.1.2. detach

detach()

Detach aggregate listeners from the specified event manager

Parameters:EventManagerInterface
Return type:void

1014.1.1.3. onBootstrap

onBootstrap()

Prepares the view layer

Parameters:$event
Return type:void

1014.1.1.4. getHelperManager

getHelperManager()

Instantiates and configures the renderer’s helper manager

Return type:ZendViewHelperPluginManager

1014.1.1.5. getResolver

getResolver()

Instantiates and configures the renderer’s resolver

Return type:ViewResolverResolverInterface

1014.1.1.6. getRenderer

getRenderer()

Instantiates and configures the renderer

Return type:ViewPhpRenderer

1014.1.1.7. getRendererStrategy

getRendererStrategy()

Instantiates and configures the renderer strategy for the view

Return type:PhpRendererStrategy

1014.1.1.8. getView

getView()

Instantiates and configures the view

Return type:View

1014.1.1.9. getLayoutTemplate

getLayoutTemplate()

Retrieves the layout template name from the configuration

Return type:string

1014.1.1.10. getMvcRenderingStrategy

getMvcRenderingStrategy()

Instantiates and configures the default MVC rendering strategy

Return type:DefaultRenderingStrategy

1014.1.1.11. getExceptionStrategy

getExceptionStrategy()

Instantiates and configures the exception strategy

Return type:ExceptionStrategy

1014.1.1.12. getRouteNotFoundStrategy

getRouteNotFoundStrategy()

Instantiates and configures the “route not found”, or 404, strategy

Return type:RouteNotFoundStrategy

1014.1.1.13. getViewModel

getViewModel()

Configures the MvcEvent view model to ensure it has the template injected

Return type:ZendViewModelModelInterface

1014.1.1.14. registerMvcRenderingStrategies

registerMvcRenderingStrategies()

Register additional mvc rendering strategies

If there is a “mvc_strategies” key of the view manager configuration, loop through it. Pull each as a service from the service manager, and, if it is a ListenerAggregate, attach it to the view, at priority 100. This latter allows each to trigger before the default mvc rendering strategy, and for them to trigger in the order they are registered.

1014.1.1.15. registerViewStrategies

registerViewStrategies()

Register additional view strategies

If there is a “strategies” key of the view manager configuration, loop through it. Pull each as a service from the service manager, and, if it is a ListenerAggregate, attach it to the view, at priority 100. This latter allows each to trigger before the default strategy, and for them to trigger in the order they are registered.

Return type:void