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

Since: 6.0.0 All methods except `view()` are deprecated and will be removed in the future.
Inheritance: extends eZ\Publish\Core\MVC\Symfony\Controller\Controller
Datei anzeigen Open project: ezsystems/ezpublish-kernel Class Usage Examples

Protected Properties

Property Type Description
$viewManager eZ\Publish\Core\MVC\Symfony\View\ViewManagerInterface

Public Methods

Method Description
__construct ( eZ\Publish\Core\MVC\Symfony\View\ViewManagerInterface $viewManager, Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface $authorizationChecker )
embedAction ( ContentView $view ) : ContentView Embed a content.
embedContent ( integer $contentId, string $viewType, boolean $layout = false, array $params = [] ) : Response Main action for viewing embedded content.
embedLocation ( integer $locationId, string $viewType, boolean $layout = false, array $params = [] ) : Response Main action for viewing embedded location.
viewAction ( ContentView $view ) : ContentView This is the default view action or a ContentView object.
viewContent ( integer $contentId, string $viewType, boolean $layout = false, array $params = [] ) : Response Main action for viewing content.
viewLocation ( integer $locationId, string $viewType, boolean $layout = false, array $params = [] ) : Response Main action for viewing content through a location in the repository.

Protected Methods

Method Description
buildResponse ( string | null $etag = null, DateTime $lastModified = null ) : Response Build the response so that depending on settings it's cacheable.
handleViewException ( Response $response, $params, Exception $e, $viewType, $contentId = null, $locationId = null )
performAccessChecks ( ) Performs the access checks.
renderContent ( eZ\Publish\API\Repository\Values\Content\Content $content, string $viewType, boolean $layout = false, array $params = [] ) : string Creates the content to be returned when viewing a Content.
renderLocation ( eZ\Publish\API\Repository\Values\Content\Location $location, string $viewType, boolean $layout = false, array $params = [] ) : string Creates the content to be returned when viewing a Location.

Method Details

__construct() public method

public __construct ( eZ\Publish\Core\MVC\Symfony\View\ViewManagerInterface $viewManager, Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface $authorizationChecker )
$viewManager eZ\Publish\Core\MVC\Symfony\View\ViewManagerInterface
$authorizationChecker Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface

buildResponse() protected method

Build the response so that depending on settings it's cacheable.
protected buildResponse ( string | null $etag = null, DateTime $lastModified = null ) : Response
$etag string | null
$lastModified DateTime
return Symfony\Component\HttpFoundation\Response

embedAction() public method

Behaves mostly like viewAction(), but with specific content load permission handling.
public embedAction ( ContentView $view ) : ContentView
$view eZ\Publish\Core\MVC\Symfony\View\ContentView
return eZ\Publish\Core\MVC\Symfony\View\ContentView

embedContent() public method

Response will be cached with HttpCache validation model (Etag).
public embedContent ( integer $contentId, string $viewType, boolean $layout = false, array $params = [] ) : Response
$contentId integer
$viewType string
$layout boolean
$params array
return Symfony\Component\HttpFoundation\Response

embedLocation() public method

Response will be cached with HttpCache validation model (Etag).
Deprecation: Since 6.0.0. Viewing locations is now done with ViewContent.
public embedLocation ( integer $locationId, string $viewType, boolean $layout = false, array $params = [] ) : Response
$locationId integer
$viewType string
$layout boolean
$params array
return Symfony\Component\HttpFoundation\Response

handleViewException() protected method

protected handleViewException ( Response $response, $params, Exception $e, $viewType, $contentId = null, $locationId = null )
$response Symfony\Component\HttpFoundation\Response
$e Exception

performAccessChecks() protected method

Performs the access checks.
protected performAccessChecks ( )

renderContent() protected method

Creates the content to be returned when viewing a Content.
protected renderContent ( eZ\Publish\API\Repository\Values\Content\Content $content, string $viewType, boolean $layout = false, array $params = [] ) : string
$content eZ\Publish\API\Repository\Values\Content\Content
$viewType string
$layout boolean
$params array
return string

renderLocation() protected method

Creates the content to be returned when viewing a Location.
protected renderLocation ( eZ\Publish\API\Repository\Values\Content\Location $location, string $viewType, boolean $layout = false, array $params = [] ) : string
$location eZ\Publish\API\Repository\Values\Content\Location
$viewType string
$layout boolean
$params array
return string

viewAction() public method

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.
public viewAction ( ContentView $view ) : ContentView
$view eZ\Publish\Core\MVC\Symfony\View\ContentView
return eZ\Publish\Core\MVC\Symfony\View\ContentView

viewContent() public method

Response will be cached with HttpCache validation model (Etag).
public viewContent ( integer $contentId, string $viewType, boolean $layout = false, array $params = [] ) : Response
$contentId integer
$viewType string
$layout boolean
$params array
return Symfony\Component\HttpFoundation\Response

viewLocation() public method

Response will be cached with HttpCache validation model (Etag).
Deprecation: Since 6.0.0. Viewing locations is now done with ViewContent.
public viewLocation ( integer $locationId, string $viewType, boolean $layout = false, array $params = [] ) : Response
$locationId integer
$viewType string
$layout boolean
$params array
return Symfony\Component\HttpFoundation\Response

Property Details

$viewManager protected_oe property

protected ViewManagerInterface,eZ\Publish\Core\MVC\Symfony\View $viewManager
return eZ\Publish\Core\MVC\Symfony\View\ViewManagerInterface