PHP 클래스 Yosymfony\Spress\Core\ContentManager\Renderizer\TwigRenderizer

저자: Victor Puertas ([email protected])
상속: implements Yosymfony\Spress\Core\ContentManager\Renderizer\RenderizerInterface
파일 보기 프로젝트 열기: spress/spress 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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