Class template


Located in File: Program_Root/template.inc.php


Template class
 This class is very fast in filling a template with specific values for
 the aplication
 

Class Variable Summary
$var_names
Default Value: ->array()<-
$files
Default Value: ->array()<-
$start
Default Value: ->'{'<-
$end
Default Value: ->'}'<-

Method Summary
load_file ( $file_id, $filename )
Function to load a template into the class.
set_identifiers ( $start, $end )
Function to load a template into the class.
traverse_array ( $file_id, $array )
This function is used only by the register() method, for going through arays and extracting the values.
register ( $file_id, $var_name )
Function to register a variable(s).
include_file ( $file_id, $filename )
Function to include another file.
parse ( $file_id )
Function for reading and parsing the
parse_loop ( $file_id, $array_name )
Function for parsing an array.
parse_sql ( $file_id, $result_name )
Function for parsing a Mysql result set.
parse_pgsql ( $file_id, $result_name )
Function for parsing a Postgres result set.
print_file ( $file_id )
Function for printing the resulting file(s).
return_file ( $file_id )
Function for returning the resulting file(s).
pprint ( $file_id, [$replacements = ''] )
Parses and then immediately prints the file. This function added by Bruce Christensen.
pget ( $file_id, [$replacements = ''] )
Parses and then immediately returns the file's contents. Function added by Bruce Christensen.
pprint_file ( $filename, [$replacements = ''] )
Loads a file, parses it, and prints it.
pget_file ( $filename, [$replacements = ''] )
Loads, parses and then immediately returns the file's contents.

Variable Detail

$var_names



$files



$start



$end




Function Detail

load_file

load_file ( $file_id, $filename )

Function to load a template into the class.

Function Parameters:
Function Info:

set_identifiers

set_identifiers ( $start, $end )

Function to load a template into the class.

Function Parameters:
Function Info:

traverse_array

traverse_array ( $file_id, $array )

This function is used only by the register() method, for going through arays and extracting the values.

Function Parameters:
Function Info:

register

register ( $file_id, $var_name )

Function to register a variable(s).

Function Parameters:
Function Info:

include_file

include_file ( $file_id, $filename )

Function to include another file.
 eg. A header/footer.

Function Parameters:
Function Info:

parse

parse ( $file_id )

Function for reading and parsing the
 html file for normal variables. Also
 now checks for include tags and if
 necessary calls include_file()

Function Parameters:
Function Info:

parse_loop

parse_loop ( $file_id, $array_name )

Function for parsing an array.

Function Parameters:
Function Info:

parse_sql

parse_sql ( $file_id, $result_name )

Function for parsing a Mysql result set.

Function Parameters:
Function Info:

parse_pgsql

parse_pgsql ( $file_id, $result_name )

Function for parsing a Postgres result set.

Function Parameters:
Function Info:

print_file

print_file ( $file_id )

Function for printing the resulting file(s).

Function Parameters:
Function Info:

return_file

return_file ( $file_id )

Function for returning the resulting file(s).

Function Parameters:
Function Info:

pprint

pprint ( $file_id, [$replacements = ''] )

Parses and then immediately prints the file. This function added by Bruce Christensen.

Function Parameters:
Function Info:

pget

pget ( $file_id, [$replacements = ''] )

Parses and then immediately returns the file's contents. Function added by Bruce Christensen.

Function Parameters:
Function Info:

pprint_file

pprint_file ( $filename, [$replacements = ''] )

Loads a file, parses it, and prints it.
 This function added by Bruce Christensen.

Function Parameters:
Function Info:

pget_file

pget_file ( $filename, [$replacements = ''] )

Loads, parses and then immediately returns the file's contents.
 Function added by Bruce Christensen.

Function Parameters:
Function Info: