\SmartTemplateParser

SmartTemplateParser Class Used by SmartTemplate Class

Summary

Methods
Properties
Constants
SmartTemplateParser()
compile()
var_name()
cmd_name()
count_subtemplates()
$template
$template_dir
$extension_tagged
$error
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$template

$template : 

The template itself

Type

$template_dir

$template_dir : 

The template filename used to extract the dirname for subtemplates

Type

$extension_tagged

$extension_tagged : 

List of used SmartTemplate Extensions

Type

$error

$error : 

Error messages

Type

Methods

SmartTemplateParser()

SmartTemplateParser(string  $template_filename) 

SmartTemplateParser Constructor

Parameters

string $template_filename

HTML Template Filename

compile()

compile(string  $compiled_template_filename = '') 

Main Template Parser

Parameters

string $compiled_template_filename

Compiled Template Filename

var_name()

var_name(string  $tag) : array

Splits Template-Style Variable Names into an Array-Name/Key-Name Components {example} : array( "_obj", "example" ) -> $_obj['example'] {example.value} : array( "_obj['example']", "value" ) -> $_obj['example']['value'] {example.0.value} : array( "_obj['example'][0]", "value" ) -> $_obj['example'][0]['value'] {top.example} : array( "_stack[0]", "example" ) -> $_stack[0]['example'] {parent.example} : array( "_stack[$_stack_cnt-1]", "example" ) -> $_stack[$_stack_cnt-1]['example'] {parent.parent.example} : array( "_stack[$_stack_cnt-2]", "example" ) -> $_stack[$_stack_cnt-2]['example']

Parameters

string $tag

Variale Name used in Template

Returns

array —

Array Name, Key Name

cmd_name()

cmd_name(string  $tag) : array

Determine Template Command from Variable Name {variable} : array( "echo", "variable" ) -> echo $_obj['variable'] {variable > new_name} : array( "_obj['new_name']=", "variable" ) -> $_obj['new_name']= $_obj['variable']

Parameters

string $tag

Variale Name used in Template

Returns

array —

Array Command, Variable

count_subtemplates()

count_subtemplates() : integer

Returns

integer —

Number of subtemplate included