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

ControllerMatch.php
Go to the documentation of this file.
1 <?php
2
7 namespace eZ\Publish\Core\MVC\Symfony\View\Builder\Registry;
8
9 use eZ\Publish\Core\MVC\Symfony\View\Builder\ViewBuilderRegistry;
10
15 class ControllerMatch implements ViewBuilderRegistry
16 {
18 private $registry = [];
19
23 public function addToRegistry(array $viewBuilders)
24 {
25 $this->registry = array_merge($this->registry, $viewBuilders);
26 }
27
35 public function getFromRegistry($controllerString)
36 {
37 if (!is_string($controllerString)) {
38 return null;
39 }
40
41 foreach ($this->registry as $viewBuilder) {
42 if ($viewBuilder->matches($controllerString)) {
43 return $viewBuilder;
44 }
45 }
46
47 return null;
48 }
49 }
eZ\Publish\Core\MVC\Symfony\View\Builder\Registry\ControllerMatch
A registry of ViewBuilders that uses the ViewBuilder's match() method to identify the builder against...
Definition: ControllerMatch.php:16
eZ\Publish\Core\MVC\Symfony\View\Builder\Registry\ControllerMatch\addToRegistry
addToRegistry(array $viewBuilders)
Definition: ControllerMatch.php:23
eZ\Publish\Core\MVC\Symfony\View\Builder\Registry\ControllerMatch\getFromRegistry
getFromRegistry($controllerString)
Returns the ViewBuilder that matches the given controller string.
Definition: ControllerMatch.php:35
eZ\Publish\Core\MVC\Symfony\View\Builder\Registry\ControllerMatch\$registry
$registry
Definition: ControllerMatch.php:18
eZ\Publish\Core\MVC\Symfony\View\Builder\ViewBuilderRegistry
A simple registry of ViewBuilders that uses the ViewBuilder's match() method to identify the builder.
Definition: ViewBuilderRegistry.php:13
eZ\Publish\Core\MVC\Symfony\View\Builder\Registry
Definition: ControllerMatch.php:7
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.