Class

eZ\Bundle\EzPublishCoreBundle\Controller\PageController

class PageController extends PageController

This controller provides the block view feature.

Methods

__construct(Manager $viewManager, PageService $pageService)

from PageController
BlockView viewAction(BlockView $view)

This is the default view action for a BlockView object.

from PageController
Response viewBlock(Block $block, array $params = array(), array $cacheSettings = array())

Render the block.

Response viewBlockById(mixed $id, array $params = array(), array $cacheSettings = array())

Renders the block with given $id.

from PageController

Details

in PageController at line 34
public __construct(Manager $viewManager, PageService $pageService)

Parameters

Manager $viewManager
PageService $pageService

in PageController at line 56
public BlockView viewAction(BlockView $view)

This is the default view action for a BlockView object.

It doesn't do anything by itself: the returned View object is rendered by the ViewRendererListener into an HttpFoundation Response.

This action can be selectively replaced by a custom action by means of block_view configuration. Custom actions can add parameters to the view and customize the Response the View will be converted to. They may also bypass the ViewRenderer by returning an HttpFoundation Response.

Cache is in both cases handled by the BlockCacheResponseListener.

Parameters

BlockView $view

Return Value

BlockView

at line 24
public Response viewBlock(Block $block, array $params = array(), array $cacheSettings = array())

Render the block.

Parameters

Block $block
array $params
array $cacheSettings settings for the HTTP cache, 'smax-age' and 'max-age' are checked.

Return Value

Response

in PageController at line 120
public Response viewBlockById(mixed $id, array $params = array(), array $cacheSettings = array())

Renders the block with given $id.

This method can be used with ESI rendering strategy.

Parameters

mixed $id Block id
array $params
array $cacheSettings settings for the HTTP cache, 'smax-age' and 'max-age' are checked.

Return Value

Response

Exceptions

NotFoundException If block could not be found.