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

Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
eZ\Publish\Core\MVC\Symfony\View\Manager Class Reference
Inheritance diagram for eZ\Publish\Core\MVC\Symfony\View\Manager:

## Public Member Functions
| __construct (EngineInterface $templateEngine, EventDispatcherInterface $eventDispatcher, Repository $repository, ConfigResolverInterface $configResolver, $viewBaseLayout, $viewConfigurator, LoggerInterface $logger=null)
| addContentViewProvider (ViewProvider $viewProvider, $priority=0)
| Registers $viewProvider as a valid content view provider. More...
| addLocationViewProvider (ViewProvider $viewProvider, $priority=0)
| Registers $viewProvider as a valid location view provider. More...
| addBlockViewProvider (ViewProvider $viewProvider, $priority=0)
| Registers $viewProvider as a valid location view provider. More...
| getAllContentViewProviders ()
| getAllLocationViewProviders ()
| getAllBlockViewProviders ()
| renderContent (Content $content, $viewType=ViewManagerInterface::VIEW_TYPE_FULL, $parameters=[])
| Renders $content by selecting the right template. More...
| renderLocation (Location $location, $viewType=ViewManagerInterface::VIEW_TYPE_FULL, $parameters=[])
| Renders $location by selecting the right template for $viewType. More...
| renderBlock (Block $block, $parameters=[])
| Renders $block by selecting the right template. More...
| renderContentView (View $view, array $defaultParams=[])
| Renders passed ContentView object via the template engine. More...

## Protected Member Functions
| sortViewProviders ($property)
| Sort the registered view providers by priority. More...

## Protected Attributes
| $templateEngine
| $logger
| $contentViewProviders = []
| $locationViewProviders = []
| $blockViewProviders = []
| $sortedContentViewProviders
| $sortedLocationViewProviders
| $sortedBlockViewProviders
| $repository
| $eventDispatcher
| $viewBaseLayout
| $configResolver

## Private Member Functions
| addViewProvider (&$property, $viewProvider, $priority)
| Helper for {. More...

## Private Attributes
| $viewConfigurator

## Additional Inherited Members
Public Attributes inherited from eZ\Publish\Core\MVC\Symfony\View\ViewManagerInterface
const | VIEW_TYPE_FULL = 'full'
const | VIEW_TYPE_LINE = 'line'

## Detailed Description

Definition at line 21 of file Publish/Core/MVC/Symfony/View/Manager.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZ\Publish\Core\MVC\Symfony\View\Manager::__construct | ( | EngineInterface | $templateEngine,
|  | EventDispatcherInterface | $eventDispatcher,
|  | Repository | $repository,
|  | ConfigResolverInterface | $configResolver,
|  |  | $viewBaseLayout,
|  |  | $viewConfigurator,
|  | LoggerInterface | $logger = `null`
| ) |  |

Definition at line 79 of file Publish/Core/MVC/Symfony/View/Manager.php.

References eZ\Publish\Core\MVC\Symfony\View\Manager\$configResolver, eZ\Publish\Core\MVC\Symfony\View\Manager\$eventDispatcher, eZ\Publish\Core\MVC\Symfony\View\Manager\$logger, eZ\Publish\Core\MVC\Symfony\View\Manager\$repository, eZ\Publish\Core\MVC\Symfony\View\Manager\$templateEngine, eZ\Publish\Core\MVC\Symfony\View\Manager\$viewBaseLayout, and eZ\Publish\Core\MVC\Symfony\View\Manager\$viewConfigurator.

## Member Function Documentation

## ◆ addBlockViewProvider()

eZ\Publish\Core\MVC\Symfony\View\Manager::addBlockViewProvider | ( | ViewProvider | $viewProvider,
|  |  | $priority = `0`
| ) |  |

Registers $viewProvider as a valid location view provider.

When this view provider will be called in the chain depends on $priority. The highest $priority is, the earliest the router will be called.

Parameters

  \eZ\Publish\Core\MVC\Symfony\View\Provider\Block | $viewProvider |
  int | $priority |

Definition at line 145 of file Publish/Core/MVC/Symfony/View/Manager.php.

References eZ\Publish\Core\MVC\Symfony\View\Manager\addViewProvider().

## ◆ addContentViewProvider()

eZ\Publish\Core\MVC\Symfony\View\Manager::addContentViewProvider | ( | ViewProvider | $viewProvider,
|  |  | $priority = `0`
| ) |  |

Registers $viewProvider as a valid content view provider.

When this view provider will be called in the chain depends on $priority. The highest $priority is, the earliest the router will be called.

Parameters

  \eZ\Publish\Core\MVC\Symfony\View\ViewProvider | $viewProvider |
  int | $priority |

Definition at line 121 of file Publish/Core/MVC/Symfony/View/Manager.php.

References eZ\Publish\Core\MVC\Symfony\View\Manager\addViewProvider().

## ◆ addLocationViewProvider()

eZ\Publish\Core\MVC\Symfony\View\Manager::addLocationViewProvider | ( | ViewProvider | $viewProvider,
|  |  | $priority = `0`
| ) |  |

Registers $viewProvider as a valid location view provider.

When this view provider will be called in the chain depends on $priority. The highest $priority is, the earliest the router will be called.

Parameters

  \eZ\Publish\Core\MVC\Symfony\View\ViewProvider | $viewProvider |
  int | $priority |

Definition at line 133 of file Publish/Core/MVC/Symfony/View/Manager.php.

References eZ\Publish\Core\MVC\Symfony\View\Manager\addViewProvider().

## ◆ addViewProvider()

eZ\Publish\Core\MVC\Symfony\View\Manager::addViewProvider | ( | & | $property,
|  |  | $viewProvider,
|  |  | $priority
| ) |  |
| private

Helper for {.

See also
  addContentViewProvider()} and {
  addLocationViewProvider()}.

Parameters

  array | $property |
  \eZ\Publish\Core\MVC\Symfony\View\ViewProvider | $viewProvider |
  int | $priority |

Definition at line 104 of file Publish/Core/MVC/Symfony/View/Manager.php.

Referenced by eZ\Publish\Core\MVC\Symfony\View\Manager\addBlockViewProvider(), eZ\Publish\Core\MVC\Symfony\View\Manager\addContentViewProvider(), and eZ\Publish\Core\MVC\Symfony\View\Manager\addLocationViewProvider().

## ◆ getAllBlockViewProviders()

eZ\Publish\Core\MVC\Symfony\View\Manager::getAllBlockViewProviders | ( |  | ) |

Returns
  \eZ\Publish\Core\MVC\Symfony\View\ViewProvider[]

Definition at line 177 of file Publish/Core/MVC/Symfony/View/Manager.php.

References eZ\Publish\Core\MVC\Symfony\View\Manager\$sortedBlockViewProviders, and eZ\Publish\Core\MVC\Symfony\View\Manager\sortViewProviders().

Referenced by eZ\Bundle\EzPublishCoreBundle\View\Manager\setSiteAccess().

## ◆ getAllContentViewProviders()

eZ\Publish\Core\MVC\Symfony\View\Manager::getAllContentViewProviders | ( |  | ) |

Returns
  \eZ\Publish\Core\MVC\Symfony\View\ViewProvider[]

Definition at line 153 of file Publish/Core/MVC/Symfony/View/Manager.php.

References eZ\Publish\Core\MVC\Symfony\View\Manager\$sortedContentViewProviders, and eZ\Publish\Core\MVC\Symfony\View\Manager\sortViewProviders().

Referenced by eZ\Bundle\EzPublishCoreBundle\View\Manager\setSiteAccess().

## ◆ getAllLocationViewProviders()

eZ\Publish\Core\MVC\Symfony\View\Manager::getAllLocationViewProviders | ( |  | ) |

Returns
  \eZ\Publish\Core\MVC\Symfony\View\ViewProvider[]

Definition at line 165 of file Publish/Core/MVC/Symfony/View/Manager.php.

References eZ\Publish\Core\MVC\Symfony\View\Manager\$sortedLocationViewProviders, and eZ\Publish\Core\MVC\Symfony\View\Manager\sortViewProviders().

Referenced by eZ\Bundle\EzPublishCoreBundle\View\Manager\setSiteAccess().

## ◆ renderBlock()

eZ\Publish\Core\MVC\Symfony\View\Manager::renderBlock | ( | Block | $block,
|  |  | $parameters = `[]`
| ) |  |

Renders $block by selecting the right template.

$block will be injected in the selected template.

Parameters

  \eZ\Publish\Core\FieldType\Page\Parts\Block | $block |
  array | $parameters | Parameters to pass to the template called to render the view. By default, it's empty. 'block' entry is reserved for the Block that is viewed.

Exceptions

Implements eZ\Publish\Core\MVC\Symfony\View\ViewManagerInterface.

Definition at line 281 of file Publish/Core/MVC/Symfony/View/Manager.php.

References eZ\Publish\Core\MVC\Symfony\View\Manager\renderContentView().

## ◆ renderContent()

eZ\Publish\Core\MVC\Symfony\View\Manager::renderContent | ( | Content | $content,
|  |  | $viewType = `ViewManagerInterface::VIEW_TYPE_FULL`,
|  |  | $parameters = `[]`
| ) |  |

Renders $content by selecting the right template.

$content will be injected in the selected template.

Parameters

  \eZ\Publish\API\Repository\Values\Content\Content | $content |
  string | $viewType | Variation of display for your content. Default is 'full'.
  array | $parameters | Parameters to pass to the template called to render the view. By default, it's empty. 'content' entry is reserved for the Content that is rendered.

Exceptions

Implements eZ\Publish\Core\MVC\Symfony\View\ViewManagerInterface.

Definition at line 220 of file Publish/Core/MVC/Symfony/View/Manager.php.

References eZ\Publish\Core\MVC\Symfony\View\Manager\renderContentView().

Referenced by eZ\Publish\Core\MVC\Symfony\View\Manager\renderLocation().

## ◆ renderContentView()

eZ\Publish\Core\MVC\Symfony\View\Manager::renderContentView | ( | View | $view,
|  | array | $defaultParams = `[]`
| ) |  |

Renders passed ContentView object via the template engine.

If $view's template identifier is a closure, then it is called directly and the result is returned as is.

Parameters

  \eZ\Publish\Core\MVC\Symfony\View\View | $view |
  array | $defaultParams |

Returns
  string

Implements eZ\Publish\Core\MVC\Symfony\View\ViewManagerInterface.

Definition at line 304 of file Publish/Core/MVC/Symfony/View/Manager.php.

References eZ\Publish\Core\MVC\Symfony\View\Manager\$viewBaseLayout, eZ\Publish\Core\MVC\Symfony\View\View\addParameters(), eZ\Publish\Core\MVC\Symfony\View\View\getParameters(), eZ\Publish\Core\MVC\Symfony\View\View\getTemplateIdentifier(), and eZ\Publish\Core\MVC\Symfony\MVCEvents\PRE_CONTENT_VIEW.

Referenced by eZ\Publish\Core\MVC\Symfony\View\Manager\renderBlock(), and eZ\Publish\Core\MVC\Symfony\View\Manager\renderContent().

## ◆ renderLocation()

eZ\Publish\Core\MVC\Symfony\View\Manager::renderLocation | ( | Location | $location,
|  |  | $viewType = `ViewManagerInterface::VIEW_TYPE_FULL`,
|  |  | $parameters = `[]`
| ) |  |

Renders $location by selecting the right template for $viewType.

$content and $location will be injected in the selected template.

Parameters

  \eZ\Publish\API\Repository\Values\Content\Location | $location |
  string | $viewType | Variation of display for your content. Default is 'full'.
  array | $parameters | Parameters to pass to the template called to render the view. By default, it's empty. 'location' and 'content' entries are reserved for the Location (and its Content) that is viewed.

Exceptions

Implements eZ\Publish\Core\MVC\Symfony\View\ViewManagerInterface.

Definition at line 252 of file Publish/Core/MVC/Symfony/View/Manager.php.

References eZ\Publish\Core\MVC\Symfony\View\Manager\renderContent().

## ◆ sortViewProviders()

eZ\Publish\Core\MVC\Symfony\View\Manager::sortViewProviders | ( |  | $property | ) |
| protected

Sort the registered view providers by priority.

The highest priority number is the highest priority (reverse sorting).

Parameters

  array | $property | view providers to sort

Returns
  \eZ\Publish\Core\MVC\Symfony\View\Provider\Content[]|\eZ\Publish\Core\MVC\Symfony\View\Provider\Location[]|\eZ\Publish\Core\MVC\Symfony\View\Provider\Block[]

Definition at line 194 of file Publish/Core/MVC/Symfony/View/Manager.php.

Referenced by eZ\Publish\Core\MVC\Symfony\View\Manager\getAllBlockViewProviders(), eZ\Publish\Core\MVC\Symfony\View\Manager\getAllContentViewProviders(), and eZ\Publish\Core\MVC\Symfony\View\Manager\getAllLocationViewProviders().

## Member Data Documentation

## ◆ $blockViewProviders

eZ\Publish\Core\MVC\Symfony\View\Manager::$blockViewProviders = []
| protected

Definition at line 48 of file Publish/Core/MVC/Symfony/View/Manager.php.

## ◆ $configResolver

eZ\Publish\Core\MVC\Symfony\View\Manager::$configResolver
| protected

Definition at line 74 of file Publish/Core/MVC/Symfony/View/Manager.php.

Referenced by eZ\Publish\Core\MVC\Symfony\View\Manager\__construct().

## ◆ $contentViewProviders

eZ\Publish\Core\MVC\Symfony\View\Manager::$contentViewProviders = []
| protected

Definition at line 34 of file Publish/Core/MVC/Symfony/View/Manager.php.

## ◆ $eventDispatcher

eZ\Publish\Core\MVC\Symfony\View\Manager::$eventDispatcher
| protected

Definition at line 63 of file Publish/Core/MVC/Symfony/View/Manager.php.

Referenced by eZ\Publish\Core\MVC\Symfony\View\Manager\__construct().

## ◆ $locationViewProviders

eZ\Publish\Core\MVC\Symfony\View\Manager::$locationViewProviders = []
| protected

Definition at line 41 of file Publish/Core/MVC/Symfony/View/Manager.php.

## ◆ $logger

eZ\Publish\Core\MVC\Symfony\View\Manager::$logger
| protected

Definition at line 27 of file Publish/Core/MVC/Symfony/View/Manager.php.

Referenced by eZ\Publish\Core\MVC\Symfony\View\Manager\__construct().

## ◆ $repository

eZ\Publish\Core\MVC\Symfony\View\Manager::$repository
| protected

Definition at line 60 of file Publish/Core/MVC/Symfony/View/Manager.php.

Referenced by eZ\Publish\Core\MVC\Symfony\View\Manager\__construct().

## ◆ $sortedBlockViewProviders

eZ\Publish\Core\MVC\Symfony\View\Manager::$sortedBlockViewProviders
| protected

Definition at line 57 of file Publish/Core/MVC/Symfony/View/Manager.php.

Referenced by eZ\Publish\Core\MVC\Symfony\View\Manager\getAllBlockViewProviders().

## ◆ $sortedContentViewProviders

eZ\Publish\Core\MVC\Symfony\View\Manager::$sortedContentViewProviders
| protected

Definition at line 51 of file Publish/Core/MVC/Symfony/View/Manager.php.

Referenced by eZ\Publish\Core\MVC\Symfony\View\Manager\getAllContentViewProviders().

## ◆ $sortedLocationViewProviders

eZ\Publish\Core\MVC\Symfony\View\Manager::$sortedLocationViewProviders
| protected

Definition at line 54 of file Publish/Core/MVC/Symfony/View/Manager.php.

Referenced by eZ\Publish\Core\MVC\Symfony\View\Manager\getAllLocationViewProviders().

## ◆ $templateEngine

eZ\Publish\Core\MVC\Symfony\View\Manager::$templateEngine
| protected

Definition at line 24 of file Publish/Core/MVC/Symfony/View/Manager.php.

Referenced by eZ\Publish\Core\MVC\Symfony\View\Manager\__construct().

## ◆ $viewBaseLayout

eZ\Publish\Core\MVC\Symfony\View\Manager::$viewBaseLayout
| protected

Definition at line 71 of file Publish/Core/MVC/Symfony/View/Manager.php.

Referenced by eZ\Publish\Core\MVC\Symfony\View\Manager\__construct(), and eZ\Publish\Core\MVC\Symfony\View\Manager\renderContentView().

## ◆ $viewConfigurator

eZ\Publish\Core\MVC\Symfony\View\Manager::$viewConfigurator
| private

Definition at line 77 of file Publish/Core/MVC/Symfony/View/Manager.php.

Referenced by eZ\Publish\Core\MVC\Symfony\View\Manager\__construct().

The documentation for this class was generated from the following file:

- Publish/Core/MVC/Symfony/View/Manager.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.