Class

eZ\Publish\Core\MVC\Symfony\View\Manager

class Manager implements ViewManagerInterface

Methods

__construct(EngineInterface $templateEngine, EventDispatcherInterface $eventDispatcher, Repository $repository, ConfigResolverInterface $configResolver, $viewBaseLayout, $viewConfigurator, LoggerInterface $logger = null)

addContentViewProvider(ViewProvider $viewProvider, int $priority)

Registers $viewProvider as a valid content view provider.

addLocationViewProvider(ViewProvider $viewProvider, int $priority)

Registers $viewProvider as a valid location view provider.

addBlockViewProvider(ViewProvider $viewProvider, int $priority)

Registers $viewProvider as a valid location view provider.

ViewProvider[] getAllContentViewProviders()

ViewProvider[] getAllLocationViewProviders()

ViewProvider[] getAllBlockViewProviders()

string renderContent(Content $content, string $viewType = ViewManagerInterface::VIEW_TYPE_FULL, array $parameters = array())

Renders $content by selecting the right template.

string renderLocation(Location $location, string $viewType = ViewManagerInterface::VIEW_TYPE_FULL, array $parameters = array())

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

string renderBlock(Block $block, array $parameters = array())

Renders $block by selecting the right template.

string renderContentView(View $view, array $defaultParams = array())

Renders passed ContentView object via the template engine.

Details

at line 97
public __construct(EngineInterface $templateEngine, EventDispatcherInterface $eventDispatcher, Repository $repository, ConfigResolverInterface $configResolver, $viewBaseLayout, $viewConfigurator, LoggerInterface $logger = null)

Parameters

EngineInterface $templateEngine
EventDispatcherInterface $eventDispatcher
Repository $repository
ConfigResolverInterface $configResolver
$viewBaseLayout
$viewConfigurator
LoggerInterface $logger

at line 139
public addContentViewProvider(ViewProvider $viewProvider, int $priority)

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

ViewProvider $viewProvider
int $priority

at line 151
public addLocationViewProvider(ViewProvider $viewProvider, int $priority)

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

ViewProvider $viewProvider
int $priority

at line 163
public addBlockViewProvider(ViewProvider $viewProvider, int $priority)

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

ViewProvider $viewProvider
int $priority

at line 171
public ViewProvider[] getAllContentViewProviders()

Return Value

ViewProvider[]

at line 183
public ViewProvider[] getAllLocationViewProviders()

Return Value

ViewProvider[]

at line 195
public ViewProvider[] getAllBlockViewProviders()

Return Value

ViewProvider[]

at line 238
public string renderContent(Content $content, string $viewType = ViewManagerInterface::VIEW_TYPE_FULL, array $parameters = array())

Renders $content by selecting the right template.

$content will be injected in the selected template.

Parameters

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.

Return Value

string

Exceptions

RuntimeException

at line 270
public string renderLocation(Location $location, string $viewType = ViewManagerInterface::VIEW_TYPE_FULL, array $parameters = array())

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

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

Parameters

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.

Return Value

string

Exceptions

RuntimeException

at line 299
public string renderBlock(Block $block, array $parameters = array())

Renders $block by selecting the right template.

$block will be injected in the selected template.

Parameters

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.

Return Value

string

Exceptions

RuntimeException

at line 322
public string renderContentView(View $view, array $defaultParams = array())

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

View $view
array $defaultParams

Return Value

string