eZPublishCommunityProject  2013.4
eZ\Publish\Core\MVC\Symfony\View\ContentView Class Reference

Main object to be rendered by the View Manager when viewing a content. More...

+ Inheritance diagram for eZ\Publish\Core\MVC\Symfony\View\ContentView:
+ Collaboration diagram for eZ\Publish\Core\MVC\Symfony\View\ContentView:

Public Member Functions

 __construct ($templateIdentifier=null, array $parameters=array())
 
 addParameters (array $parameters)
 Adds a hash of parameters to the existing parameters. More...
 
 getParameter ($parameterName)
 Returns parameter value by $parameterName. More...
 
 getParameters ()
 
 getTemplateIdentifier ()
 
 hasParameter ($parameterName)
 Checks if $parameterName exists. More...
 
 setParameters (array $parameters)
 
 setTemplateIdentifier ($templateIdentifier)
 

Protected Attributes

 $parameters
 
 $templateIdentifier
 

Detailed Description

Main object to be rendered by the View Manager when viewing a content.

Holds the path to the template to be rendered by the view manager and the parameters to inject in it.

The template path can be a closure. In that case, the view manager will invoke it instead of loading a template. $parameters will be passed to the callable in addition to the Content or Location object (depending on the context). The prototype of the closure must be : namespace Foo; use eZ, eZ;

// For a content function ( ContentInfo $contentInfo, array $parameters = array() ) { // Do something to render // Must return a string to display }

// For a location function ( Location $location, array $parameters = array() ) { // Do something to render // Must return a string to display }

Constructor & Destructor Documentation

eZ\Publish\Core\MVC\Symfony\View\ContentView::__construct (   $templateIdentifier = null,
array  $parameters = array() 
)
Parameters
string | \Closure$templateIdentifierValid path to the template. Can also be a closure.
array$parametersHash of parameters to pass to the template/closure.
Exceptions
\eZ\Publish\Core\Base\Exceptions\InvalidArgumentType

Member Function Documentation

eZ\Publish\Core\MVC\Symfony\View\ContentView::addParameters ( array  $parameters)

Adds a hash of parameters to the existing parameters.

Parameters
array$parameters

Implements eZ\Publish\Core\MVC\Symfony\View\ContentViewInterface.

eZ\Publish\Core\MVC\Symfony\View\ContentView::getParameter (   $parameterName)

Returns parameter value by $parameterName.

Throws an if $parameterName is not set.

Parameters
string$parameterName
Exceptions
\InvalidArgumentException
Returns
mixed

Implements eZ\Publish\Core\MVC\Symfony\View\ContentViewInterface.

eZ\Publish\Core\MVC\Symfony\View\ContentView::getParameters ( )
eZ\Publish\Core\MVC\Symfony\View\ContentView::getTemplateIdentifier ( )
eZ\Publish\Core\MVC\Symfony\View\ContentView::hasParameter (   $parameterName)

Checks if $parameterName exists.

Parameters
string$parameterName
Returns
boolean

Implements eZ\Publish\Core\MVC\Symfony\View\ContentViewInterface.

Referenced by eZ\Publish\Core\MVC\Symfony\View\ContentView\getParameter().

eZ\Publish\Core\MVC\Symfony\View\ContentView::setParameters ( array  $parameters)
Parameters
array$parametersHash of parameters to pass to the template/closure

Implements eZ\Publish\Core\MVC\Symfony\View\ContentViewInterface.

eZ\Publish\Core\MVC\Symfony\View\ContentView::setTemplateIdentifier (   $templateIdentifier)
Parameters
string | \Closure$templateIdentifier
Exceptions
\eZ\Publish\Core\Base\Exceptions\InvalidArgumentType

Implements eZ\Publish\Core\MVC\Symfony\View\ContentViewInterface.

Member Data Documentation


The documentation for this class was generated from the following file: