PHP Класс Jarves\ContentRender

Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
$contents array Cache of the current contents stage.

Защищенные свойства (Protected)

Свойство Тип Описание
$types Jarves\ContentTypes\AbstractType[]

Открытые методы

Метод Описание
__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 %}.

Защищенные методы

Метод Описание
filterContentsForAccess ( Content[] $contents ) : array Filters $contents and returns only $content items which have valid access. (is visible, accessible by current user etc)

Описание методов

__construct() публичный метод

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 addType ( string $type, AbstractType $contentType )
$type string
$contentType Jarves\ContentTypes\AbstractType

filterContentsForAccess() защищенный метод

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[]
Результат array

getContentTypes() публичный метод

public getContentTypes ( ) : AbstractType[]
Результат Jarves\ContentTypes\AbstractType[]

getSlotContents() публичный метод

public getSlotContents ( integer $nodeId, integer $slotId ) : Content[]
$nodeId integer
$slotId integer
Результат Jarves\Model\Content[]

getTypeRenderer() публичный метод

public getTypeRenderer ( string $type ) : AbstractType
$type string
Результат Jarves\ContentTypes\AbstractType

renderContent() публичный метод

Build HTML for given content.
public renderContent ( Jarves\Model\ContentInterface $content, array $parameters = [] ) : string
$content Jarves\Model\ContentInterface
$parameters array
Результат string

renderContents() публичный метод

Renders all Content elements into html.
public renderContents ( Content[] $contents ) : string
$contents Jarves\Model\Content[]
Результат string generated html

renderSingleSlot() публичный метод

public renderSingleSlot ( integer $nodeId = null, integer $slotId = 1, array $params = [] ) : string
$nodeId integer
$slotId integer
$params array
Результат string

renderSlot() публичный метод

public renderSlot ( integer $nodeId = null, integer $slotId = 1, array $params = [] ) : string
$nodeId integer
$slotId integer
$params array
Результат string

renderSlotContents() публичный метод

Build HTML for given contents, used in {% contents 1 %}.
public renderSlotContents ( array $contents, array $slotProperties ) : string | null
$contents array
$slotProperties array
Результат string | null

Описание свойств

$contents публичное свойство

Cache of the current contents stage.
public array $contents
Результат array

$types защищенное свойство

protected AbstractType[],Jarves\ContentTypes $types
Результат Jarves\ContentTypes\AbstractType[]