PHP Class Latte\Engine

Author: David Grudl
Inheritance: extends latte\Object
Datei anzeigen Open project: nette/latte Class Usage Examples

Public Properties

Property Type Description
$onCompile callable[]

Public Methods

Method Description
__construct ( )
addFilter ( $name, $callback ) : static Registers run-time filter.
addMacro ( $name, latte\IMacro $macro ) : static Adds new macro.
addProvider ( $name, $value ) : static Adds new provider.
compile ( $name ) : string Compiles template to PHP code.
createTemplate ( $name, array $params = [] ) : Template Creates template object.
getCacheFile ( $name ) : string
getCompiler ( ) : Compiler
getFilters ( ) : string[] Returns all run-time filters.
getLoader ( ) : latte\ILoader
getParser ( ) : Parser
getProviders ( ) : array Returns all providers.
getTemplateClass ( $name ) : string
invokeFilter ( $name, array $args ) : mixed Call a run-time filter.
render ( $name, array $params = [], $block = NULL ) : void Renders template to output.
renderToString ( $name, array $params = [], $block = NULL ) : string Renders template to string.
setAutoRefresh ( $on = TRUE ) : static Sets auto-refresh mode.
setContentType ( $type ) : static
setLoader ( latte\ILoader $loader ) : static
setTempDirectory ( $path ) : static Sets path to temporary directory.
warmupCache ( $name ) : void Compiles template to cache.

Private Methods

Method Description
isExpired ( $file, $name ) : boolean
loadTemplate ( $name ) : void

Method Details

__construct() public method

public __construct ( )

addFilter() public method

Registers run-time filter.
public addFilter ( $name, $callback ) : static
return static

addMacro() public method

Adds new macro.
public addMacro ( $name, latte\IMacro $macro ) : static
$macro latte\IMacro
return static

addProvider() public method

Adds new provider.
public addProvider ( $name, $value ) : static
return static

compile() public method

Compiles template to PHP code.
public compile ( $name ) : string
return string

createTemplate() public method

Creates template object.
public createTemplate ( $name, array $params = [] ) : Template
$params array
return Latte\Runtime\Template

getCacheFile() public method

public getCacheFile ( $name ) : string
return string

getCompiler() public method

public getCompiler ( ) : Compiler
return Compiler

getFilters() public method

Returns all run-time filters.
public getFilters ( ) : string[]
return string[]

getLoader() public method

public getLoader ( ) : latte\ILoader
return latte\ILoader

getParser() public method

public getParser ( ) : Parser
return Parser

getProviders() public method

Returns all providers.
public getProviders ( ) : array
return array

getTemplateClass() public method

public getTemplateClass ( $name ) : string
return string

invokeFilter() public method

Call a run-time filter.
public invokeFilter ( $name, array $args ) : mixed
$args array
return mixed

render() public method

Renders template to output.
public render ( $name, array $params = [], $block = NULL ) : void
$params array
return void

renderToString() public method

Renders template to string.
public renderToString ( $name, array $params = [], $block = NULL ) : string
$params array
return string

setAutoRefresh() public method

Sets auto-refresh mode.
public setAutoRefresh ( $on = TRUE ) : static
return static

setContentType() public method

public setContentType ( $type ) : static
return static

setLoader() public method

public setLoader ( latte\ILoader $loader ) : static
$loader latte\ILoader
return static

setTempDirectory() public method

Sets path to temporary directory.
public setTempDirectory ( $path ) : static
return static

warmupCache() public method

Compiles template to cache.
public warmupCache ( $name ) : void
return void

Property Details

$onCompile public_oe property

public callable[] $onCompile
return callable[]