PHP 클래스 Box\Brainy\Templates\Template

상속: extends TemplateBase
파일 보기 프로젝트 열기: box/brainy 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$compile_id string $compile_id
$compiled
$properties array special compiled template properties
$required_plugins array required plugins
$source
$template_resource string Full template resource

공개 메소드들

메소드 설명
__construct ( string $tplResource, Box\Brainy\Brainy $brainy, Template $parent = null, mixed $compileID = null, boolean | void $suppressData = false ) Create template data object
compileTemplateSource ( ) : string Compiles the template
createTemplateCodeFrame ( string $content = '' ) : string Create code frame for compiled and cached templates
decodeProperties ( array $properties ) : boolean This function is executed automatically when a compiled or cached template file is included
getScopePointer ( integer $scope ) : mixed Get parent or root of template parent chain
mustCompile ( ) : boolean Returns if the current template must be compiled by the Smarty compiler
recompileAndLoadCopy ( ) : void Recompiles the template and also writes a copy of the compiled code to a temporary destination to load from. This is so that stale compiled code will be refreshed in HHVM, which does not support requiring the same file twice even if it has been changed.
writeFile ( string $_filepath, string $_contents, Box\Brainy\Brainy $smarty ) : boolean Writes file in a safe way to disk

메소드 상세

__construct() 공개 메소드

Some of the global Smarty settings copied to template scope It load the required template resources and cacher plugins
public __construct ( string $tplResource, Box\Brainy\Brainy $brainy, Template $parent = null, mixed $compileID = null, boolean | void $suppressData = false )
$tplResource string template resource string
$brainy Box\Brainy\Brainy Brainy instance
$parent Template back pointer to parent object with variables or null
$compileID mixed compile id or null
$suppressData boolean | void Prevents data from being copied into the variable scope

compileTemplateSource() 공개 메소드

Compiles the template
public compileTemplateSource ( ) : string
리턴 string The compiled template source

createTemplateCodeFrame() 공개 메소드

Create code frame for compiled and cached templates
public createTemplateCodeFrame ( string $content = '' ) : string
$content string optional template content
리턴 string

decodeProperties() 공개 메소드

This function is executed automatically when a compiled or cached template file is included
public decodeProperties ( array $properties ) : boolean
$properties array special template properties
리턴 boolean flag if compiled or cache file is valid

getScopePointer() 공개 메소드

Get parent or root of template parent chain
public getScopePointer ( integer $scope ) : mixed
$scope integer pqrent or root scope
리턴 mixed object

mustCompile() 공개 메소드

It does compare the timestamps of template source and the compiled templates
public mustCompile ( ) : boolean
리턴 boolean true if the template must be compiled

recompileAndLoadCopy() 공개 메소드

Recompiles the template and also writes a copy of the compiled code to a temporary destination to load from. This is so that stale compiled code will be refreshed in HHVM, which does not support requiring the same file twice even if it has been changed.
public recompileAndLoadCopy ( ) : void
리턴 void

writeFile() 공개 정적인 메소드

Writes file in a safe way to disk
public static writeFile ( string $_filepath, string $_contents, Box\Brainy\Brainy $smarty ) : boolean
$_filepath string complete filepath
$_contents string file content
$smarty Box\Brainy\Brainy smarty instance
리턴 boolean true

프로퍼티 상세

$compile_id 공개적으로 프로퍼티

$compile_id
public string $compile_id
리턴 string

$compiled 공개적으로 프로퍼티

public $compiled

$properties 공개적으로 프로퍼티

special compiled template properties
public array $properties
리턴 array

$required_plugins 공개적으로 프로퍼티

required plugins
public array $required_plugins
리턴 array

$source 공개적으로 프로퍼티

public $source

$template_resource 공개적으로 프로퍼티

Full template resource
public string $template_resource
리턴 string