\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
Methods Properties Constants
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)

Parameters

$content

No description

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.

Returns

string

The compiled template

compileASSIGN()
compileASSIGN($params)

Parameters

$params

No description

compileCALL()
compileCALL($params)

Parameters

$params

No description

compileCAPTURE()
compileCAPTURE($params)

Parameters

$params

No description

compileCUSTOMFUNC()
compileCUSTOMFUNC($name, $params)

Parameters

$name

No description

$params

No description

compileCUSTOMHANDLERFUNC()
compileCUSTOMHANDLERFUNC($method, $params)

Parameters

$method

No description

$params

No description

compileELSE()
compileELSE($params)

Parameters

$params

No description

compileELSEIF()
compileELSEIF($params)

Parameters

$params

No description

compileENDCAPTURE()
compileENDCAPTURE()
compileENDFOREACH()
compileENDFOREACH($tag)

Parameters

$tag

No description

compileENDFUNCTION()
compileENDFUNCTION()
compileENDIF()
compileENDIF($tag)

Parameters

$tag

No description

compileENDSECTION()
compileENDSECTION($tag)

Parameters

$tag

No description

compileFOREACH()
compileFOREACH($params)

Parameters

$params

No description

compileFOREACHELSE()
compileFOREACHELSE($tag)

Parameters

$tag

No description

compileFUNCTION()
compileFUNCTION($params)

Parameters

$params

No description

compileIF()
compileIF($params)

Parameters

$params

No description

compileINCLUDE()
compileINCLUDE($params)

Parameters

$params

No description

compileLDELIM()
compileLDELIM($tag)

Parameters

$tag

No description

compilePARAMS()
compilePARAMS($params)

Parameters

$params

No description

compileRDELIM()
compileRDELIM($tag)

Parameters

$tag

No description

compileSECTION()
compileSECTION($params)

Parameters

$params

No description

compileSECTIONELSE()
compileSECTIONELSE($tag)

Parameters

$tag

No description

compileURL()
compileURL($tag)

Parameters

$tag

No description

compileVAR()
compileVAR($name)

Parameters

$name

No description

compileVARS()
compileVARS($string)

Parameters

$string

No description

loadFromFile()
loadFromFile($file)
Read the template from a file

Parameters

$filemixed

Can be either a Hazaar\File object or a string to a file on disk.

loadFromString()
loadFromString($content)
Load the SMARTy template from a supplied string

Parameters

$contentmixed

The template source code

parsePARAMS()
parsePARAMS($params)

Parameters

$params

No description

registerFunctionHandler()
registerFunctionHandler($object)

Parameters

$object

No description

render()
render($params = Array ( ) ) : string
Render the template with the supplied parameters and return the rendered content

Parameters

$paramsmixed

Parameters to use when embedding variables in the rendered template.

Returns

string
replaceCONFIG_VAR()
replaceCONFIG_VAR($name)

Parameters

$name

No description

replaceVAR()
replaceVAR($name)

Parameters

$name

No description

setType()
setType($value, $type = 'string', $args = null)

Parameters

$value

No description

$type

No description

$args

No description