Properties

$PageVars

$PageVars : 

Page variables.

Type

$Instances

$Instances : 

Created instances of different objects.

Type

$Headers

$Headers : 

HTTP headers.

Type

$Template

$Template : 

Loaded template content.

Type

Methods

set_page_var()

set_page_var(  $Var,   $Value) 

Setting page variables.

Parameters

$Var
$Value

compile_page_vars()

compile_page_vars(  $Content) 

Compiling the page with it's variables.

Parameters

$Content

get_block_data()

get_block_data(string  $String, string  $BlockStart, string  $BlockEnd) : mixed

Method returns content between {$BlockStart} and {$BlockEnd} tags.

Parameters

string $String
  • processing string.
string $BlockStart
  • start of the block.
string $BlockEnd
  • end of the block.

Returns

mixed —

Block content. Or false if the block was not found.

find_macro()

find_macro(string  $StringData, integer  $TmpStartPos, integer  $TmpEndPos, integer  $StartPos, integer  $Counter, integer  $MacroStartPos, integer  $ParamStartPos) : string

Getting macro start.

Parameters

string $StringData
  • Parsing string.
integer $TmpStartPos
  • Search temporary starting position.
integer $TmpEndPos
  • Search temporary ending position.
integer $StartPos
  • Search starting position.
integer $Counter
  • Brackets counter.
integer $MacroStartPos
  • Position of the macro.
integer $ParamStartPos
  • Position of macro's parameters.

Returns

string —

Macro parameters.

get_macro_parameters()

get_macro_parameters(string  $String, string  $Name, integer  $StartPos = -1) : mixed

Method fetches macro parameters.

Parameters

string $String
  • string to be parsed.
string $Name
  • macro name.
integer $StartPos
  • starting position of the search.

Returns

mixed —

Macro parameters or false if the macro was not found.

replace_block()

replace_block(string  $Str,   $BlockStart, string  $BlockEnd, string  $Content) 

Method replaces block with content.

Parameters

string $Str
  • string to process.
$BlockStart
string $BlockEnd
  • ending marker of the block.
string $Content
  • content to replace block.

compile_print()

compile_print(string  $String, mixed  $Record) : string

Method processes 'print' macro.

Parameters

string $String
  • processing string.
mixed $Record
  • printing record.

Returns

string —

Processed string.

compile_foreach()

compile_foreach(string  $String, mixed  $Record) : string

Method processes 'foreach' macro.

Parameters

string $String
  • processing string.
mixed $Record
  • printing record.

Returns

string —

Processed string.

compile_values()

compile_values(  $String, mixed  $Record) : string

Method processes values substitution.

Parameters

$String
mixed $Record
  • printing record.

Returns

string —

Processed string.

compile_switch()

compile_switch(string  $String) : string

Method processes 'switch' macro.

Parameters

string $String
  • processing string.

Returns

string —

Processed string.

print_record()

print_record(string  $String, mixed  $Record) 

Method replaces all {var-name} placeholders in $String with fields from $Record.

Parameters

string $String

-processing string.

mixed $Record
  • printing record.

__construct()

__construct(  $PlaceHolder) 

Template �onstructor.

Parameters

$PlaceHolder

get_instance()

get_instance() 

Function returns instance of the object.

__clone()

__clone() 

Cloner.

destroy()

destroy() 

Destroy object.

add_header()

add_header(  $Header,   $Value) 

Method adds header.

Parameters

$Header
$Value

get_headers()

get_headers() 

Method returns all template's headers.

compile()

compile() 

Compile template.

get_possible_block_positions()

get_possible_block_positions(  $Positions) 

Method returns starts and ends of the block.

Parameters

$Positions

get_all_block_positions()

get_all_block_positions(  $String,   $BlockStart,   $BlockEnd) 

Method returns block's start and end.

Parameters

$String
$BlockStart
$BlockEnd

get_block_positions()

get_block_positions(  $String,   $BlockStart,   $BlockEnd) 

Method returns block's start and end.

Parameters

$String
$BlockStart
$BlockEnd

handle_macro_start()

handle_macro_start(  $TmpStartPos,   $TmpEndPos,   $StartPos,   $Counter) 

Getting macro start.

Parameters

$TmpStartPos
$TmpEndPos
$StartPos
$Counter

handle_macro_end()

handle_macro_end(integer  $TmpStartPos, integer  $TmpEndPos, integer  $StartPos, integer  $Counter, integer  $MacroStartPos) 

Getting macro end.

Parameters

integer $TmpStartPos
  • Search temporary starting position.
integer $TmpEndPos
  • Search temporary ending position.
integer $StartPos
  • Search starting position.
integer $Counter
  • Brackets counter.
integer $MacroStartPos
  • Position of the macro.

handle_macro_start_end()

handle_macro_start_end(string  $StringData, integer  $TmpStartPos, integer  $TmpEndPos, integer  $StartPos, integer  $Counter, integer  $MacroStartPos) 

Getting macro bounds.

Parameters

string $StringData
  • Parsing string.
integer $TmpStartPos
  • Search temporary starting position.
integer $TmpEndPos
  • Search temporary ending position.
integer $StartPos
  • Search starting position.
integer $Counter
  • Brackets counter.
integer $MacroStartPos
  • Position of the macro.

apply_foreach_data()

apply_foreach_data(string  $Str, string  $Parameters, mixed  $Data) 

Method applyes data for foreach block content.

Parameters

string $Str
  • string to process.
string $Parameters
  • block parameters.
mixed $Data
  • replacement data.

apply_print_data()

apply_print_data(string  $Str, string  $Parameters, mixed  $Data) 

Method applyes data for print block content.

Parameters

string $Str
  • string to process.
string $Parameters
  • block parameters.
mixed $Data
  • replacement data.

unwrap_blocks()

unwrap_blocks(string  $String, mixed  $Record) 

Method unwraps data.

Parameters

string $String

-processing string.

mixed $Record
  • printing record.

output_headers()

output_headers() 

Method outputs all template's headers.