Class flTemplateEngine
flTemplateEngine Class
Class to implement an extensible template engine which supports snippets (code blocks), chunks (html blocks) and placeholders (variables).
Syntax: [[snippet]] or [[!snippet]] for non-cached [[$chunk]] or [[!$chunk]] for non-cached [[+placeholder]] or [[!+placeholder]] for non-cached
All but placeholders can take parameters e.g. [[snippet &var=1
&var=2
]]
in the case of a chunk placeholders of the same name as the parameters are
replaced with the passed variables.
Direct known subclasses
Copyright: Copyright (c) 2007 - 2015 fusionLib. All rights reserved.
Located at system/libs/Template/flTemplateEngine.php
Methods summary
public static
|
|
public
|
|
public
|
|
public
string
|
|
public
|
|
public
boolean
|
|
public
string
|
|
public
string
|
#
parseChunk( string $name, array $placeholders = array() )
Get the contents of a named chunk parsing it and replacing tags. |
public
|
|
public
string
|
|
protected
|
#
_processTag( string $type, string $tag, array $params )
Internal function to process a tag, override to add tags. |
public
string
|
#
parseString( string $string, array $placeholders = array() )
Parse a string replacing tags as required. |
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
protected
string
|
|
public
string
|
|
public
integer
|
Properties summary
protected
array
|
$placeholders
Array holding placeholder values. |
#
array()
|
protected
array
|
$chunkCache
Cache of chunks and those registered through registerChunk. |
#
array()
|
protected
array
|
$snippetCache
Cache of snippets and those registered through registerSnippet. |
#
array()
|
protected
|
$cache
The optional cache object. |
#
null
|
protected
integer
|
$lifetime
The lifetime for the page in the cache. |
#
null
|
protected
|
$codeBuffer
The code buffer object. |
#
null
|
protected
string
|
$theme
The theme to use within the themes folder. |
#
''
|
protected
string
|
$childTheme
The child theme to use. |
#
''
|
protected
string
|
$cssFramework
The CSS framework to use. |
#
''
|
protected
string
|
$tagChars
Supported tag characters. |
#
'+$*'
|
protected
integer
|
$lastDocFullCacheTime
The timestamp of the last documents full cache build. |
#
0
|
protected static
|
$db
The database engine to read template elements from. |
#
null
|