PHP 클래스 Airship\Engine\Lens

For MVC developers, this is analogous to a View
상속: use trait Airship\Engine\Bolt\Log
파일 보기 프로젝트 열기: paragonie/airship 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( Twig_Environment $twigEnv ) Lens constructor.
addGlobal ( string $key, &mixed $value ) : self Add a global variable to Twig
append ( string $key, mixed $val ) : self Maintain an array of values for later rendering, appending the supplied value.
display ( string $base, array $params = [], string $mime = 'text/html;charset=UTF-8' ) : boolean Render a template and print out its contents.
filter ( string $name, callable $func = null ) : self Add a filter to Twig
func ( string $name, callable $func = null, array $is_safe = ['html'] ) : self Add a function to our Twig environment
listFilters ( ) : array Get all filters
loadMotifCargo ( string $name ) : self Load the cargo for these motifs
loadMotifConfig ( string $name ) : self Load the config for this motif
prepend ( string $key, mixed $val ) : self Maintain an array of values for later rendering, prepending the supplied value.
registerGlobal ( string $name, &array &$value ) : self Register an array or object as a Twig global.
render ( string $base, array $params = [] ) : string Render a template and return its contents as a string.
resetBaseTemplate ( ) : self Reset the base template
sendStandardHeaders ( string $mimeType ) : void Send HTTP headers
setActiveMotif ( string $name ) : boolean Set the active motif
setBaseTemplate ( string $name ) : self Override the base template
store ( string $key, mixed $val ) : self Persist state for later rendering.
unsafeDisplay ( string $file, array $params = [], string $mime = 'text/html;charset=UTF-8' ) : boolean Render a template and print out its contents without sanity checks.
unsafeRender ( string $file, array $params = [] ) : string Render a template and print out its contents without sanity checks.

메소드 상세

__construct() 공개 메소드

Lens constructor.
public __construct ( Twig_Environment $twigEnv )
$twigEnv Twig_Environment

addGlobal() 공개 메소드

Add a global variable to Twig
public addGlobal ( string $key, &mixed $value ) : self
$key string
$value &mixed
리턴 self

append() 공개 메소드

Maintain an array of values for later rendering, appending the supplied value.
public append ( string $key, mixed $val ) : self
$key string Index
$val mixed Value
리턴 self

display() 공개 메소드

Render a template and print out its contents.
public display ( string $base, array $params = [], string $mime = 'text/html;charset=UTF-8' ) : boolean
$base string Template to render (e.g. 'index' or 'dir/index')
$params array Parameters to pass towards the array
$mime string MIME type header to transmit
리턴 boolean

filter() 공개 메소드

Add a filter to Twig
public filter ( string $name, callable $func = null ) : self
$name string - Name to access n Twig
$func callable - function to apply
리턴 self

func() 공개 메소드

Add a function to our Twig environment
public func ( string $name, callable $func = null, array $is_safe = ['html'] ) : self
$name string - Name to access in Twig
$func callable - function definition
$is_safe array
리턴 self

listFilters() 공개 메소드

Get all filters
public listFilters ( ) : array
리턴 array

loadMotifCargo() 공개 메소드

Load the cargo for these motifs
public loadMotifCargo ( string $name ) : self
$name string
리턴 self

loadMotifConfig() 공개 메소드

Load the config for this motif
public loadMotifConfig ( string $name ) : self
$name string
리턴 self

prepend() 공개 메소드

Maintain an array of values for later rendering, prepending the supplied value.
public prepend ( string $key, mixed $val ) : self
$key string Index
$val mixed Value
리턴 self

registerGlobal() 공개 메소드

Register an array or object as a Twig global.
public registerGlobal ( string $name, &array &$value ) : self
$name string Name to access in Twig (by ref)
$value &array
리턴 self

render() 공개 메소드

Render a template and return its contents as a string.
public render ( string $base, array $params = [] ) : string
$base string Template to render (e.g. 'index' or 'dir/index')
$params array Parameters to pass towards the array
리턴 string

resetBaseTemplate() 공개 메소드

Reset the base template
public resetBaseTemplate ( ) : self
리턴 self

sendStandardHeaders() 공개 메소드

Send HTTP headers
public sendStandardHeaders ( string $mimeType ) : void
$mimeType string
리턴 void

setActiveMotif() 공개 메소드

Set the active motif
public setActiveMotif ( string $name ) : boolean
$name string
리턴 boolean

setBaseTemplate() 공개 메소드

Override the base template
public setBaseTemplate ( string $name ) : self
$name string
리턴 self

store() 공개 메소드

Persist state for later rendering.
public store ( string $key, mixed $val ) : self
$key string Index
$val mixed Value
리턴 self

unsafeDisplay() 공개 메소드

Render a template and print out its contents without sanity checks.
public unsafeDisplay ( string $file, array $params = [], string $mime = 'text/html;charset=UTF-8' ) : boolean
$file string Template to render (e.g. 'index' or 'dir/index')
$params array Parameters to pass towards the array
$mime string MIME type
리턴 boolean

unsafeRender() 공개 메소드

Render a template and print out its contents without sanity checks.
public unsafeRender ( string $file, array $params = [] ) : string
$file string Template to render (e.g. 'index' or 'dir/index')
$params array Parameters to pass towards the array
리턴 string