Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Configurator/ViewProvider.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\MVC\Symfony\View\Configurator;
8
9 use eZ\Publish\Core\MVC\Symfony\View\Configurator;
10 use eZ\Publish\Core\MVC\Symfony\View\Provider\Registry;
11 use eZ\Publish\Core\MVC\Symfony\View\View;
12
19 class ViewProvider implements Configurator
20 {
22 private $providerRegistry;
23
29 public function __construct(Registry $providersRegistry)
30 {
31 $this->providerRegistry = $providersRegistry;
32 }
33
34 public function configure(View $view)
35 {
36 foreach ($this->providerRegistry->getViewProviders($view) as $viewProvider) {
37 if ($providerView = $viewProvider->getView($view)) {
38 $view->setConfigHash($providerView->getConfigHash());
39 if (($templateIdentifier = $providerView->getTemplateIdentifier()) !== null) {
40 $view->setTemplateIdentifier($templateIdentifier);
41 }
42
43 if (($controllerReference = $providerView->getControllerReference()) !== null) {
44 $view->setControllerReference($controllerReference);
45 }
46
47 $view->addParameters($providerView->getParameters());
48
49 return;
50 }
51 }
52 }
53 }
eZ\Publish\Core\MVC\Symfony\View\Configurator\ViewProvider
Configures a view based on the ViewProviders.
Definition: Configurator/ViewProvider.php:20
eZ\Publish\Core\MVC\Symfony\View\Configurator\ViewProvider\__construct
__construct(Registry $providersRegistry)
ViewProvider constructor.
Definition: Configurator/ViewProvider.php:29
eZ\Publish\Core\MVC\Symfony\View\Configurator\ViewProvider\$providerRegistry
$providerRegistry
Definition: Configurator/ViewProvider.php:22
eZ\Publish\Core\MVC\Symfony\View\Configurator\ViewProvider\configure
configure(View $view)
Definition: Configurator/ViewProvider.php:34
eZ\Publish\Core\MVC\Symfony\View\Provider\Registry
Definition: MVC/Symfony/View/Provider/Registry.php:13
eZ\Publish\Core\MVC\Symfony\View\Configurator
Configures a View object.
Definition: Configurator.php:15
eZ\Publish\Core\MVC\Symfony\View\View
Main interface for Views of Value objects (content, block...).
Definition: Publish/Core/MVC/Symfony/View/View.php:16
eZ\Publish\Core\MVC\Symfony\View\View\setConfigHash
setConfigHash(array $config)
Injects the config hash that was used to match and generate the current view.
eZ\Publish\Core\MVC\Symfony\View\View\setTemplateIdentifier
setTemplateIdentifier($templateIdentifier)
Sets $templateIdentifier to the content view.
eZ\Publish\Core\MVC\Symfony\View\View\addParameters
addParameters(array $parameters)
Adds a hash of parameters to the existing parameters.
eZ\Publish\Core\MVC\Symfony\View\View\setControllerReference
setControllerReference(ControllerReference $controllerReference)
eZ\Publish\Core\MVC\Symfony\View\Configurator
Definition: Configurator/ViewProvider.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.