Class

eZ\Publish\Core\MVC\Symfony\Controller\Content\ViewController

class ViewController extends Controller

This controller provides the content 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(ViewManagerInterface $viewManager, AuthorizationCheckerInterface $authorizationChecker)

ContentView viewAction(ContentView $view)

This is the default view action or a ContentView object.

ContentView embedAction(ContentView $view)

Embed a content.

Response viewLocation(int $locationId, string $viewType, bool $layout = false, array $params = array())

Main action for viewing content through a location in the repository.

Response embedLocation(int $locationId, string $viewType, bool $layout = false, array $params = array())

Main action for viewing embedded location.

Response viewContent(int $contentId, string $viewType, bool $layout = false, array $params = array())

Main action for viewing content.

Response embedContent(int $contentId, string $viewType, bool $layout = false, array $params = array())

Main action for viewing embedded content.

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 46
public __construct(ViewManagerInterface $viewManager, AuthorizationCheckerInterface $authorizationChecker)

Parameters

ViewManagerInterface $viewManager
AuthorizationCheckerInterface $authorizationChecker

at line 68
public ContentView viewAction(ContentView $view)

This is the default view action or a ContentView 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 content_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 CacheViewResponseListener.

Parameters

ContentView $view

Return Value

ContentView

at line 81
public ContentView embedAction(ContentView $view)

Embed a content.

Behaves mostly like viewAction(), but with specific content load permission handling.

Parameters

ContentView $view

Return Value

ContentView

at line 142
public Response viewLocation(int $locationId, string $viewType, bool $layout = false, array $params = array())

Main action for viewing content through a location in the repository.

Response will be cached with HttpCache validation model (Etag).

Parameters

int $locationId
string $viewType
bool $layout
array $params

Return Value

Response

Exceptions

AccessDeniedException
NotFoundHttpException
Exception

at line 202
public Response embedLocation(int $locationId, string $viewType, bool $layout = false, array $params = array())

Main action for viewing embedded location.

Response will be cached with HttpCache validation model (Etag).

Parameters

int $locationId
string $viewType
bool $layout
array $params

Return Value

Response

Exceptions

AccessDeniedException
NotFoundHttpException
Exception

at line 286
public Response viewContent(int $contentId, string $viewType, bool $layout = false, array $params = array())

Main action for viewing content.

Response will be cached with HttpCache validation model (Etag).

Parameters

int $contentId
string $viewType
bool $layout
array $params

Return Value

Response

Exceptions

AccessDeniedException
NotFoundHttpException
Exception

at line 343
public Response embedContent(int $contentId, string $viewType, bool $layout = false, array $params = array())

Main action for viewing embedded content.

Response will be cached with HttpCache validation model (Etag).

Parameters

int $contentId
string $viewType
bool $layout
array $params

Return Value

Response

Exceptions

AccessDeniedException
NotFoundHttpException
Exception