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 Zend\View\HelperPluginManager)
- ViewTemplateMapResolver (also aliased to Zend\View\Resolver\TemplateMapResolver)
- ViewTemplatePathStack (also aliased to Zend\View\Resolver\TemplatePathStack)
- ViewResolver (also aliased to Zend\View\Resolver\AggregateResolver and ResolverInterface)
- ViewRenderer (also aliased to Zend\View\Renderer\PhpRenderer and RendererInterface)
- ViewPhpRendererStrategy (also aliased to Zend\View\Strategy\PhpRendererStrategy)
- View (also aliased to Zend\View\View)
- DefaultRenderingStrategy (also aliased to Zend\Mvc\View\Http\DefaultRenderingStrategy)
- ExceptionStrategy (also aliased to Zend\Mvc\View\Http\ExceptionStrategy)
- RouteNotFoundStrategy (also aliased to Zend\Mvc\View\Http\RouteNotFoundStrategy and 404Strategy)
- ViewModel
Synopsis
- // members
- protected $config;
- protected MvcEvent $event;
- protected ServiceManager $services;
- protected $exceptionStrategy;
- protected $helperManager;
- protected $mvcRenderingStrategy;
- protected $renderer;
- protected $rendererStrategy;
- protected $resolver;
- protected $routeNotFoundStrategy;
- protected $view;
- protected $viewModel;
- // Inherited members from AbstractListenerAggregate
- protected array $listeners;
- // methods
- public void attach()
- public void detach()
- public void onBootstrap()
- public HelperPluginManager getHelperManager()
- public ResolverInterface getResolver()
- public PhpRenderer getRenderer()
- public PhpRendererStrategy getRendererStrategy()
- public View getView()
- public string getLayoutTemplate()
- public DefaultRenderingStrategy getMvcRenderingStrategy()
- public ExceptionStrategy getExceptionStrategy()
- public RouteNotFoundStrategy getRouteNotFoundStrategy()
- public void getInjectTemplateListener()
- public ModelInterface getViewModel()
- protected void registerMvcRenderingStrategies()
- protected void registerViewStrategies()
- // Inherited methods from AbstractListenerAggregate
- public void detach()
Hierarchy
Members
protected
- $config —
- $event — Zend\Mvc\MvcEvent
- $exceptionStrategy
- $helperManager
- $listeners — array
- $mvcRenderingStrategy
- $renderer
- $rendererStrategy
- $resolver
- $routeNotFoundStrategy
- $services — Zend\ServiceManager\ServiceManager
- $view
- $viewModel
Methods
protected
- registerMvcRenderingStrategies() — Register additional mvc rendering strategies
- registerViewStrategies() — Register additional view strategies
public
- attach() — {@inheritDoc}
- detach() — Detach aggregate listeners from the specified event manager
- getExceptionStrategy() — Instantiates and configures the exception strategy
- getHelperManager() — Instantiates and configures the renderer's helper manager
- getInjectTemplateListener()
- getLayoutTemplate() — Retrieves the layout template name from the configuration
- getMvcRenderingStrategy() — Instantiates and configures the default MVC rendering strategy
- getRenderer() — Instantiates and configures the renderer
- getRendererStrategy() — Instantiates and configures the renderer strategy for the view
- getResolver() — Instantiates and configures the renderer's resolver
- getRouteNotFoundStrategy() — Instantiates and configures the "route not found", or 404, strategy
- getView() — Instantiates and configures the view
- getViewModel() — Configures the MvcEvent view model to ensure it has the template injected
- onBootstrap() — Prepares the view layer
Inherited from Zend\EventManager\AbstractListenerAggregate
public
- detach() — {@inheritDoc}