View\Manager & View\Provider
The role of the
(eZ\Publish\Core\MVC\Symfony\)View\Manager is to select the right template for displaying a given content item or location. It aggregates objects called content and location view providers which respectively implement
Each time a content item is to be displayed through the
View\Manager iterates over the registered content or location
View\Provider objects and calls
Provided View\Provider implementations
Based on application configuration.
Forwards view selection to the legacy kernel by running the old content/view module.
View\Provider\Locationonly deals with
Locationobjects and implements
View\Provider\Contentonly deals with
ContentInfoobjects and implements
When to develop a custom
- You want a custom template selection based on a very specific state of your application
- You depend on external resources for view selection
- You want to override the default one (based on configuration) for some reason
View\Provider objects need to be properly registered in the service container with the
ezpublish.content_view_provider service tag.
|Tag attribute name||Usage|
An integer giving the priority to the
The priority range is from -255 to 255
Example Custom ContentViewProvider is not working. Path to eZ\Publish\MVC\View\ContentViewProvider is wrong with eZ 5.0 platform
Philippe Vincent-Royol: Fixed, thanks