Class

eZ\Publish\Core\MVC\Symfony\Controller\PageController

class PageController extends Controller

This controller provides the block view feature.

Methods

mixed getParameter(string $parameterName, mixed $defaultValue = null)

Returns value for $parameterName and fallbacks to $defaultValue if not defined.

from Controller
bool hasParameter(string $parameterName)

Checks if $parameterName is defined.

from Controller
ConfigResolverInterface getConfigResolver()

from Controller
Response render(string $view, array $parameters = array(), Response $response = null)

Renders a view.

from Controller
EngineInterface getTemplateEngine()

from Controller
LoggerInterface|null getLogger()

from Controller
Repository getRepository()

from Controller
Request getRequest()

from Controller
EventDispatcherInterface getEventDispatcher()

from Controller
bool isGranted(Attribute $attribute)

Checks if current user has granted access to provided attribute.

from Controller
__construct(Manager $viewManager, PageService $pageService)

BlockView viewAction(BlockView $view)

This is the default view action for a BlockView object.

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.

Details

in Controller at line 28
public mixed getParameter(string $parameterName, mixed $defaultValue = null)

Returns value for $parameterName and fallbacks to $defaultValue if not defined.

Parameters

string $parameterName
mixed $defaultValue

Return Value

mixed

in Controller at line 44
public bool hasParameter(string $parameterName)

Checks if $parameterName is defined.

Parameters

string $parameterName

Return Value

bool

in Controller at line 52
public ConfigResolverInterface getConfigResolver()

in Controller at line 66
public Response render(string $view, array $parameters = array(), Response $response = null)

Renders a view.

Parameters

string $view The view name
array $parameters An array of parameters to pass to the view
Response $response

Return Value

Response

in Controller at line 80
public EngineInterface getTemplateEngine()

Return Value

EngineInterface

in Controller at line 88
public LoggerInterface|null getLogger()

Return Value

LoggerInterface|null

in Controller at line 96
public Repository getRepository()

Return Value

Repository

in Controller at line 104
public Request getRequest()

Return Value

Request

in Controller at line 112
public EventDispatcherInterface getEventDispatcher()

Return Value

EventDispatcherInterface

in Controller at line 124
public bool isGranted(Attribute $attribute)

Checks if current user has granted access to provided attribute.

Parameters

Attribute $attribute

Return Value

bool

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

Parameters

Manager $viewManager
PageService $pageService

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 71
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

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.