Property | Type | Description | |
---|---|---|---|
$arrayLoader | |||
$isLayoutsProcessed | |||
$layoutExtension | |||
$layouts | |||
$twig |
Method | Description | |
---|---|---|
__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. |
Method | Description | |
---|---|---|
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 ( ) |
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" |
public addInclude ( $id, $content, array $attributes = [] ) | ||
$attributes | array |
public addTwigTag ( Twig_TokenParser $tokenParser ) | ||
$tokenParser | Twig_TokenParser |
protected getLayoutNameWithNamespace ( string $name ) : string | ||
$name | string | The layout name |
return | string |
protected getLayoutWithExtension ( $layoutName, $contentName ) |
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 |
return | string | The page rendered |