eZPublishCommunityProject  2013.6
eZ\Publish\Core\MVC\Symfony\View\Manager Class Reference
+ Inheritance diagram for eZ\Publish\Core\MVC\Symfony\View\Manager:
+ Collaboration diagram for eZ\Publish\Core\MVC\Symfony\View\Manager:

Public Member Functions

 __construct (EngineInterface $templateEngine, EventDispatcherInterface $eventDispatcher, Repository $repository, $viewBaseLayout, LoggerInterface $logger=null)
 
 addBlockViewProvider (BlockViewProvider $viewProvider, $priority=0)
 Registers $viewProvider as a valid location view provider. More...
 
 addContentViewProvider (ContentViewProvider $viewProvider, $priority=0)
 Registers $viewProvider as a valid content view provider. More...
 
 addLocationViewProvider (LocationViewProvider $viewProvider, $priority=0)
 Registers $viewProvider as a valid location view provider. More...
 
 getAllBlockViewProviders ()
 
 getAllContentViewProviders ()
 
 getAllLocationViewProviders ()
 
 renderBlock (Block $block, $parameters=array())
 Renders $block by selecting the right template. More...
 
 renderContent (Content $content, $viewType=ViewManagerInterface::VIEW_TYPE_FULL, $parameters=array())
 Renders $content by selecting the right template. More...
 
 renderContentView (ContentViewInterface $view, array $defaultParams=array())
 Renders passed ContentView object via the template engine. More...
 
 renderLocation (Location $location, $viewType=ViewManagerInterface::VIEW_TYPE_FULL, $parameters=array())
 Renders $location by selecting the right template for $viewType. More...
 

Protected Member Functions

 sortViewProviders ($property)
 Sort the registered view providers by priority. More...
 

Protected Attributes

 $blockViewProviders = array()
 
 $contentViewProviders = array()
 
 $eventDispatcher
 
 $locationViewProviders = array()
 
 $logger
 
 $repository
 
 $sortedBlockViewProviders
 
 $sortedContentViewProviders
 
 $sortedLocationViewProviders
 
 $templateEngine
 
 $viewBaseLayout
 

Private Member Functions

 addViewProvider (&$property, $viewProvider, $priority)
 Helper for {. More...
 

Additional Inherited Members

- Public Attributes inherited from eZ\Publish\Core\MVC\Symfony\View\ViewManagerInterface
const VIEW_TYPE_FULL = 'full'
 
const VIEW_TYPE_LINE = 'line'
 

Constructor & Destructor Documentation

eZ\Publish\Core\MVC\Symfony\View\Manager::__construct ( EngineInterface  $templateEngine,
EventDispatcherInterface  $eventDispatcher,
Repository  $repository,
  $viewBaseLayout,
LoggerInterface  $logger = null 
)

Member Function Documentation

eZ\Publish\Core\MVC\Symfony\View\Manager::addBlockViewProvider ( BlockViewProvider  $viewProvider,
  $priority = 0 
)

Registers $viewProvider as a valid location view provider.

When this view provider will be called in the chain depends on $priority. The highest $priority is, the earliest the router will be called.

Parameters
\eZ\Publish\Core\MVC\Symfony\View\Provider\Block$viewProvider
int$priority
eZ\Publish\Core\MVC\Symfony\View\Manager::addContentViewProvider ( ContentViewProvider  $viewProvider,
  $priority = 0 
)

Registers $viewProvider as a valid content view provider.

When this view provider will be called in the chain depends on $priority. The highest $priority is, the earliest the router will be called.

Parameters
\eZ\Publish\Core\MVC\Symfony\View\Provider\Content$viewProvider
int$priority
eZ\Publish\Core\MVC\Symfony\View\Manager::addLocationViewProvider ( LocationViewProvider  $viewProvider,
  $priority = 0 
)

Registers $viewProvider as a valid location view provider.

When this view provider will be called in the chain depends on $priority. The highest $priority is, the earliest the router will be called.

Parameters
\eZ\Publish\Core\MVC\Symfony\View\Provider\Location$viewProvider
int$priority
eZ\Publish\Core\MVC\Symfony\View\Manager::addViewProvider ( $property,
  $viewProvider,
  $priority 
)
private
eZ\Publish\Core\MVC\Symfony\View\Manager::getAllBlockViewProviders ( )
eZ\Publish\Core\MVC\Symfony\View\Manager::getAllContentViewProviders ( )
eZ\Publish\Core\MVC\Symfony\View\Manager::getAllLocationViewProviders ( )
eZ\Publish\Core\MVC\Symfony\View\Manager::renderBlock ( Block  $block,
  $parameters = array() 
)

Renders $block by selecting the right template.

$block will be injected in the selected template.

Parameters
\eZ\Publish\Core\FieldType\Page\Parts\Block$block
array$parametersParameters to pass to the template called to render the view. By default, it's empty. 'block' entry is reserved for the Block that is viewed.
Exceptions
\RuntimeException
Returns
string

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

eZ\Publish\Core\MVC\Symfony\View\Manager::renderContent ( Content  $content,
  $viewType = ViewManagerInterface::VIEW_TYPE_FULL,
  $parameters = array() 
)

Renders $content by selecting the right template.

$content will be injected in the selected template.

Parameters
\eZ\Publish\API\Repository\Values\Content\Content$content
string$viewTypeVariation of display for your content. Default is 'full'.
array$parametersParameters to pass to the template called to render the view. By default, it's empty. 'content' entry is reserved for the Content that is rendered.
Exceptions
\RuntimeException
Returns
string

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

eZ\Publish\Core\MVC\Symfony\View\Manager::renderContentView ( ContentViewInterface  $view,
array  $defaultParams = array() 
)

Renders passed ContentView object via the template engine.

If $view's template identifier is a closure, then it is called directly and the result is returned as is.

Parameters
\eZ\Publish\Core\MVC\Symfony\View\ContentViewInterface$view
array$defaultParams
Returns
string

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

Referenced by eZ\Publish\Core\MVC\Symfony\View\Manager\renderBlock(), eZ\Publish\Core\MVC\Symfony\View\Manager\renderContent(), and eZ\Publish\Core\MVC\Symfony\View\Manager\renderLocation().

eZ\Publish\Core\MVC\Symfony\View\Manager::renderLocation ( Location  $location,
  $viewType = ViewManagerInterface::VIEW_TYPE_FULL,
  $parameters = array() 
)

Renders $location by selecting the right template for $viewType.

$content and $location will be injected in the selected template.

Parameters
\eZ\Publish\API\Repository\Values\Content\Location$location
string$viewTypeVariation of display for your content. Default is 'full'.
array$parametersParameters to pass to the template called to render the view. By default, it's empty. 'location' and 'content' entries are reserved for the Location (and its Content) that is viewed.
Exceptions
\RuntimeException
Returns
string

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

eZ\Publish\Core\MVC\Symfony\View\Manager::sortViewProviders (   $property)
protected

Sort the registered view providers by priority.

The highest priority number is the highest priority (reverse sorting)

Parameters
array$propertyview providers to sort
Returns
[]|[]|[]

Referenced by eZ\Publish\Core\MVC\Symfony\View\Manager\getAllBlockViewProviders(), eZ\Publish\Core\MVC\Symfony\View\Manager\getAllContentViewProviders(), and eZ\Publish\Core\MVC\Symfony\View\Manager\getAllLocationViewProviders().

Member Data Documentation

eZ\Publish\Core\MVC\Symfony\View\Manager::$blockViewProviders = array()
protected
eZ\Publish\Core\MVC\Symfony\View\Manager::$contentViewProviders = array()
protected
eZ\Publish\Core\MVC\Symfony\View\Manager::$eventDispatcher
protected
eZ\Publish\Core\MVC\Symfony\View\Manager::$locationViewProviders = array()
protected
eZ\Publish\Core\MVC\Symfony\View\Manager::$logger
protected
eZ\Publish\Core\MVC\Symfony\View\Manager::$repository
protected
eZ\Publish\Core\MVC\Symfony\View\Manager::$sortedBlockViewProviders
protected
eZ\Publish\Core\MVC\Symfony\View\Manager::$sortedContentViewProviders
protected
eZ\Publish\Core\MVC\Symfony\View\Manager::$sortedLocationViewProviders
protected
eZ\Publish\Core\MVC\Symfony\View\Manager::$templateEngine
protected
eZ\Publish\Core\MVC\Symfony\View\Manager::$viewBaseLayout
protected

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