Hazaar\Template
Smarty
Smarty 2.0 Templates

This class implements the entire Smarty 2.0 template specification. For documentation on the Smarty 2.0 template format see the Smarty 2.0 online documentation: https://www.smarty.net/docsv2/en/

Tags are in the format of {$tagname}. This tag would reference a parameter passed to the parser with the array key value of 'tagname'. Such as:

$tpl = new \Hazaar\Template\Smarty($template_content);
$tpl->render(array('tagname' => 'Hello, World!'));
Summary
MethodsPropertiesConstants
No constants
Properties
$__capture_stack
$__capture_stack
$__compiled_content
$__compiled_content
$__content
$__content
$__custom_function_handler
$__custom_function_handler
$__custom_functions
$__custom_functions
$__foreach_stack
$__foreach_stack
$__section_stack
$__section_stack
$allow_globals
$allow_globals
$ldelim
$ldelim
Static
$modifiers
$modifiers
$rdelim
$rdelim
Static
$tags
$tags
Methods
__construct()
__construct($content = null)
compile()
compile() : string
Compile the template ready for rendering

This will normally happen automatically when calling Hazaar\Template\Smarty::render() but can be called separately if needed. The compiled template content is returned and can be stored externally.

compileASSIGN()
compileASSIGN($params)
compileCALL()
compileCALL($params)
compileCAPTURE()
compileCAPTURE($params)
compileCUSTOMFUNC()
compileCUSTOMFUNC($name, $params)
compileCUSTOMHANDLERFUNC()
compileCUSTOMHANDLERFUNC($method, $params)
compileELSE()
compileELSE($params)
compileELSEIF()
compileELSEIF($params)
compileENDCAPTURE()
compileENDCAPTURE()
compileENDFOREACH()
compileENDFOREACH($tag)
compileENDFUNCTION()
compileENDFUNCTION()
compileENDIF()
compileENDIF($tag)
compileENDSECTION()
compileENDSECTION($tag)
compileFOREACH()
compileFOREACH($params)
compileFOREACHELSE()
compileFOREACHELSE($tag)
compileFUNCTION()
compileFUNCTION($params)
compileIF()
compileIF($params)
compileINCLUDE()
compileINCLUDE($params)
compileLDELIM()
compileLDELIM($tag)
compilePARAMS()
compilePARAMS($params)
compileRDELIM()
compileRDELIM($tag)
compileSECTION()
compileSECTION($params)
compileSECTIONELSE()
compileSECTIONELSE($tag)
compileURL()
compileURL($tag)
compileVAR()
compileVAR($name)
compileVARS()
compileVARS($string)
loadFromFile()
loadFromFile($file)
Read the template from a file
loadFromString()
loadFromString($content)
Load the SMARTy template from a supplied string
parsePARAMS()
parsePARAMS($params)
registerFunctionHandler()
registerFunctionHandler($object)
render()
render($params = Array ( ) ) : string
Render the template with the supplied parameters and return the rendered content
replaceCONFIG_VAR()
replaceCONFIG_VAR($name)
replaceVAR()
replaceVAR($name)
setType()
setType($value, $type = 'string', $args = null)