PHP Класс Yosymfony\Spress\Core\ContentManager\Renderizer\TwigRenderizer

Автор: Victor Puertas ([email protected])
Наследование: implements Yosymfony\Spress\Core\ContentManager\Renderizer\RenderizerInterface
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$arrayLoader
$isLayoutsProcessed
$layoutExtension
$layouts
$twig

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

Метод Описание
__construct ( Twig_Environment $twig, Twig_Loader_Array $arrayLoader, array $layoutExtension ) Construct.
addInclude ( $id, $content, array $attributes = [] )
addLayout ( string $id, string $content, array $attributes = [] ) Add a new layout.
addTwigFilter ( string $name, callable $filter, array $options = [] ) Adds a new Twig filter.
addTwigFunction ( string $name, callable $function, array $options = [] ) Adds a new Twig function.
addTwigTag ( Twig_TokenParser $tokenParser ) Adds a new Twig tag.
addTwigTest ( string $name, callable $test, array $options = [] ) Adds a new Twig test.
clear ( )
renderBlocks ( string $id, string $content, array $attributes ) : string Render a blocks of content (layout NOT included).
renderPage ( string $id, string $content, string $layoutName, array $siteAttributes ) : string Render a page completely (layout included). The value of $content param will be placed at "page.content" attribute.

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

Метод Описание
getLayoutAttribute ( array $attributes, string $contentName ) : string Get the value of layout attribute.
getLayoutNameWithNamespace ( string $name ) : string Gets the layout name with the namespace prefix.
getLayoutWithExtension ( $layoutName, $contentName )
processLayouts ( )

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

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

Construct.
public __construct ( Twig_Environment $twig, Twig_Loader_Array $arrayLoader, array $layoutExtension )
$twig Twig_Environment The Twig instance
$arrayLoader Twig_Loader_Array The loader
$layoutExtension array Extension availables for layouts. e.g: "html", "html.twig", "twig"

addInclude() публичный Метод

public addInclude ( $id, $content, array $attributes = [] )
$attributes array

addLayout() публичный Метод

Add a new layout.
public addLayout ( string $id, string $content, array $attributes = [] )
$id string The identifier of the layout. e.g: path
$content string The content of the layout
$attributes array The attributes of the layout. "layout" attribute has a special meaning

addTwigFilter() публичный Метод

Adds a new Twig filter.
См. также: http://twig.sensiolabs.org/doc/advanced.html#filters Twig documentation
public addTwigFilter ( string $name, callable $filter, array $options = [] )
$name string Name of filter
$filter callable Filter implementation
$options array

addTwigFunction() публичный Метод

Adds a new Twig function.
См. также: http://twig.sensiolabs.org/doc/advanced.html#functions Twig documentation
public addTwigFunction ( string $name, callable $function, array $options = [] )
$name string Name of filter
$function callable Filter implementation
$options array

addTwigTag() публичный Метод

Adds a new Twig tag.
См. также: http://twig.sensiolabs.org/doc/advanced.html#tags Twig documentation
public addTwigTag ( Twig_TokenParser $tokenParser )
$tokenParser Twig_TokenParser

addTwigTest() публичный Метод

Adds a new Twig test.
См. также: http://twig.sensiolabs.org/doc/advanced.html#tests Twig documentation
public addTwigTest ( string $name, callable $test, array $options = [] )
$name string Name of test
$test callable
$options array

clear() публичный Метод

public clear ( )

getLayoutAttribute() защищенный Метод

Get the value of layout attribute.
protected getLayoutAttribute ( array $attributes, string $contentName ) : string
$attributes array List of attributes
$contentName string The identifier of the content
Результат string

getLayoutNameWithNamespace() защищенный Метод

Gets the layout name with the namespace prefix.
protected getLayoutNameWithNamespace ( string $name ) : string
$name string The layout name
Результат string

getLayoutWithExtension() защищенный Метод

protected getLayoutWithExtension ( $layoutName, $contentName )

processLayouts() защищенный Метод

protected processLayouts ( )

renderBlocks() публичный Метод

Render a blocks of content (layout NOT included).
public renderBlocks ( string $id, string $content, array $attributes ) : string
$id string The path of the item
$content string The content
$attributes array The attributes for using inside the content
Результат string The block rendered

renderPage() публичный Метод

Render a page completely (layout included). The value of $content param will be placed at "page.content" attribute.
public renderPage ( string $id, string $content, string $layoutName, array $siteAttributes ) : string
$id string The path of the item
$content string The page content
$layoutName string The layout name
$siteAttributes array The attributes for using inside the content. "layout" attribute has a special meaning
Результат string The page rendered

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

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

protected $arrayLoader

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

protected $isLayoutsProcessed

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

protected $layoutExtension

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

protected $layouts

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

protected $twig