Class

eZ\Bundle\EzPublishCoreBundle\View\Manager

class Manager extends Manager implements SiteAccessAware

Methods

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

from Manager
addContentViewProvider(ViewProvider $viewProvider, int $priority)

Registers $viewProvider as a valid content view provider.

from Manager
addLocationViewProvider(ViewProvider $viewProvider, int $priority)

Registers $viewProvider as a valid location view provider.

from Manager
addBlockViewProvider(ViewProvider $viewProvider, int $priority)

Registers $viewProvider as a valid location view provider.

from Manager
ViewProvider[] getAllContentViewProviders()

from Manager
ViewProvider[] getAllLocationViewProviders()

from Manager
ViewProvider[] getAllBlockViewProviders()

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

Renders $content by selecting the right template.

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

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

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

Renders $block by selecting the right template.

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

Renders passed ContentView object via the template engine.

from Manager
setSiteAccess(SiteAccess $siteAccess = null)

Changes SiteAccess.

Details

in Manager 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

in Manager 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

in Manager 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

in Manager 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

in Manager at line 171
public ViewProvider[] getAllContentViewProviders()

Return Value

ViewProvider[]

in Manager at line 183
public ViewProvider[] getAllLocationViewProviders()

Return Value

ViewProvider[]

in Manager at line 195
public ViewProvider[] getAllBlockViewProviders()

Return Value

ViewProvider[]

in Manager 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

in Manager 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

in Manager 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

in Manager 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

at line 24
public setSiteAccess(SiteAccess $siteAccess = null)

Changes SiteAccess.

Passed SiteAccess will be injected in all location/content/block view providers to allow them to change their internal configuration based on this new SiteAccess.

Parameters

SiteAccess $siteAccess