PHP Class Jarves\ContentRender

Show file Open project: jarves/jarves Class Usage Examples

Public Properties

Property Type Description
$contents array Cache of the current contents stage.

Protected Properties

Property Type Description
$types Jarves\ContentTypes\AbstractType[]

Public Methods

Method Description
__construct ( Jarves $jarves, StopwatchHelper $stopwatch, EditMode $editMode, Cacher $cacher, Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher, PageStack $pageStack, Symfony\Component\Templating\EngineInterface $templating )
addType ( string $type, AbstractType $contentType )
getContentTypes ( ) : AbstractType[]
getSlotContents ( integer $nodeId, integer $slotId ) : Content[]
getTypeRenderer ( string $type ) : AbstractType
renderContent ( Jarves\Model\ContentInterface $content, array $parameters = [] ) : string Build HTML for given content.
renderContents ( Content[] $contents ) : string Renders all Content elements into html.
renderSingleSlot ( integer $nodeId = null, integer $slotId = 1, array $params = [] ) : string
renderSlot ( integer $nodeId = null, integer $slotId = 1, array $params = [] ) : string
renderSlotContents ( array $contents, array $slotProperties ) : string | null Build HTML for given contents, used in {% contents 1 %}.

Protected Methods

Method Description
filterContentsForAccess ( Content[] $contents ) : array Filters $contents and returns only $content items which have valid access. (is visible, accessible by current user etc)

Method Details

__construct() public method

public __construct ( Jarves $jarves, StopwatchHelper $stopwatch, EditMode $editMode, Cacher $cacher, Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher, PageStack $pageStack, Symfony\Component\Templating\EngineInterface $templating )
$jarves Jarves
$stopwatch StopwatchHelper
$editMode EditMode
$cacher Jarves\Cache\Cacher
$eventDispatcher Symfony\Component\EventDispatcher\EventDispatcherInterface
$pageStack PageStack
$templating Symfony\Component\Templating\EngineInterface

addType() public method

public addType ( string $type, AbstractType $contentType )
$type string
$contentType Jarves\ContentTypes\AbstractType

filterContentsForAccess() protected method

Filters $contents and returns only $content items which have valid access. (is visible, accessible by current user etc)
protected filterContentsForAccess ( Content[] $contents ) : array
$contents Jarves\Model\Content[]
return array

getContentTypes() public method

public getContentTypes ( ) : AbstractType[]
return Jarves\ContentTypes\AbstractType[]

getSlotContents() public method

public getSlotContents ( integer $nodeId, integer $slotId ) : Content[]
$nodeId integer
$slotId integer
return Jarves\Model\Content[]

getTypeRenderer() public method

public getTypeRenderer ( string $type ) : AbstractType
$type string
return Jarves\ContentTypes\AbstractType

renderContent() public method

Build HTML for given content.
public renderContent ( Jarves\Model\ContentInterface $content, array $parameters = [] ) : string
$content Jarves\Model\ContentInterface
$parameters array
return string

renderContents() public method

Renders all Content elements into html.
public renderContents ( Content[] $contents ) : string
$contents Jarves\Model\Content[]
return string generated html

renderSingleSlot() public method

public renderSingleSlot ( integer $nodeId = null, integer $slotId = 1, array $params = [] ) : string
$nodeId integer
$slotId integer
$params array
return string

renderSlot() public method

public renderSlot ( integer $nodeId = null, integer $slotId = 1, array $params = [] ) : string
$nodeId integer
$slotId integer
$params array
return string

renderSlotContents() public method

Build HTML for given contents, used in {% contents 1 %}.
public renderSlotContents ( array $contents, array $slotProperties ) : string | null
$contents array
$slotProperties array
return string | null

Property Details

$contents public property

Cache of the current contents stage.
public array $contents
return array

$types protected property

protected AbstractType[],Jarves\ContentTypes $types
return Jarves\ContentTypes\AbstractType[]