PHP 클래스 Webiny\Component\TemplateEngine\Bridge\Smarty\Smarty

상속: implements Webiny\Component\TemplateEngine\Bridge\TemplateEngineInterface, use trait Webiny\Component\ServiceManager\ServiceManagerTrait
파일 보기 프로젝트 열기: Webiny/Framework 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( ConfigObject $config ) Base constructor.
assign ( string $var, mixed $value ) : void Assign a variable and its value into the template engine.
fetch ( string $template, array $parameters = [] ) : string Fetch the template from the given location, parse it and return the output.
getCacheDir ( ) : string Returns the current cache dir.
getCompileDir ( ) : string Returns the current compile dir.
getForceCompile ( ) : boolean Returns the current value of force_compile flag.
getMergeCompiledIncludes ( ) : boolean Returns the current value of inheritance_merge_compiled_includes flag.
getTemplateDir ( ) : string Returns the current template dir.
registerExtensions ( ) Gets the registered Smarty extensions that have been registered over the ServiceManager and assigns them to current Smarty instance.
registerPlugin ( Plugin $plugin ) : void Register a plugin for the template engine.
render ( string $template, array $parameters = [] ) : void Fetch the template from the given location, parse it and output the result to the browser.
setCacheDir ( string $cacheDir ) Set Smarty cache dir.
setCompileDir ( string $compileDir ) Set Smarty compile dir.
setForceCompile ( boolean $forceCompile ) Force to re-compile the templates on every refresh.
setMergeCompiledIncludes ( boolean $mergeCompiledIncludes ) Force to re-compile the templates on every refresh.
setTemplateDir ( string $templateDir ) : void Root path where the templates are stored.

메소드 상세

__construct() 공개 메소드

Base constructor.
public __construct ( ConfigObject $config )
$config Webiny\Component\Config\ConfigObject Configuration for the template engine.

assign() 공개 메소드

Assign a variable and its value into the template engine.
public assign ( string $var, mixed $value ) : void
$var string Variable name.
$value mixed Variable value.
리턴 void

fetch() 공개 메소드

Fetch the template from the given location, parse it and return the output.
public fetch ( string $template, array $parameters = [] ) : string
$template string Path to the template.
$parameters array A list of parameters to pass to the template.
리턴 string Parsed template.

getCacheDir() 공개 메소드

Returns the current cache dir.
public getCacheDir ( ) : string
리턴 string Absolute path to cache dir.

getCompileDir() 공개 메소드

Returns the current compile dir.
public getCompileDir ( ) : string
리턴 string Absolute path to compile dir.

getForceCompile() 공개 메소드

Returns the current value of force_compile flag.
public getForceCompile ( ) : boolean
리턴 boolean

getMergeCompiledIncludes() 공개 메소드

Returns the current value of inheritance_merge_compiled_includes flag.

getTemplateDir() 공개 메소드

Returns the current template dir.
public getTemplateDir ( ) : string
리턴 string Absolute path to template dir.

registerExtensions() 공개 메소드

NOTE: This function is automatically called by the class constructor.
public registerExtensions ( )

registerPlugin() 공개 메소드

Register a plugin for the template engine.
public registerPlugin ( Plugin $plugin ) : void
$plugin Webiny\Component\TemplateEngine\Plugin
리턴 void

render() 공개 메소드

Fetch the template from the given location, parse it and output the result to the browser.
public render ( string $template, array $parameters = [] ) : void
$template string Path to the template.
$parameters array A list of parameters to pass to the template.
리턴 void

setCacheDir() 공개 메소드

Set Smarty cache dir.
public setCacheDir ( string $cacheDir )
$cacheDir string Absolute path where to store cache files.

setCompileDir() 공개 메소드

Set Smarty compile dir.
public setCompileDir ( string $compileDir )
$compileDir string Absolute path where to store compiled files.

setForceCompile() 공개 메소드

Force to re-compile the templates on every refresh.
public setForceCompile ( boolean $forceCompile )
$forceCompile boolean

setMergeCompiledIncludes() 공개 메소드

Force to re-compile the templates on every refresh.
public setMergeCompiledIncludes ( boolean $mergeCompiledIncludes )
$mergeCompiledIncludes boolean

setTemplateDir() 공개 메소드

Root path where the templates are stored.
public setTemplateDir ( string $templateDir ) : void
$templateDir string
리턴 void