PHP 클래스 Tale\Jade\Renderer\AdapterBase

Provides some requirements for the renderer adapters. The key is the ->render() method with actually does the rendering.
상속: use trait Tale\ConfigurableTrait
파일 보기 프로젝트 열기: talesoft/tale-jade 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( Renderer $renderer, array $options = null ) Creates a new adapter.
getRenderer ( ) : Renderer Returns the attached renderer this adapter was created in.
render ( string $path, array $args = null ) : string Renders a jade file by a given path.

메소드 상세

__construct() 공개 메소드

If you create a child-adapter, make sure to set your default options correctly Something along these lines: parent::__construct($renderer, array_replace_recursive([ 'your' => 'default', 'option' => 'array' ], $options ? $options : []);
public __construct ( Renderer $renderer, array $options = null )
$renderer Tale\Jade\Renderer the renderer this adapter is created in
$options array the options array for the adapter

getRenderer() 공개 메소드

Returns the attached renderer this adapter was created in.
public getRenderer ( ) : Renderer
리턴 Tale\Jade\Renderer

render() 추상적인 공개 메소드

The extension can be omitted if it's the extension set in the Compiler-options ('.jade' by default) The given $args-argument should be an associative array and will be passed as variables that you can use inside the rendered template file Notice that the path is relative to the Compiler-option 'paths' or, if no paths passed, the paths in get_include_path() You might just echo the result, cache it or do anything else with it
abstract public render ( string $path, array $args = null ) : string
$path string the relative path to be rendered
$args array the variables for the template
리턴 string the rendered markup