higrid.net


other_package\hgTemplate
hgcommon.php at line 586

Class hgTemplate

hgTemplate

public class hgTemplate

Simple template engine class (use [@tag] tags in your templates).

See Also:
Broculos.net Programming Tutorials
Author:
Nuno Freitas
Version:
1.0

Field Summary
mixed

$sanitize

Constructor Summary
void

__construct(string file)

Creates a new Template object and sets its associated file.

Method Summary
void

set(string key, string value)

Sets a value for replacing a specific tag.

string

output(str str_template)

Outputs the content of the template, replacing the keys for its respective values.

static string

merge(array templates, string separator, str str_template)

Merges the content from an array of templates and separates it with $separator.

Field Detail

hgcommon.php at line 602

sanitize

public mixed $sanitize = true

Constructor Detail

hgcommon.php at line 609

__construct

public void __construct(string file)

Creates a new Template object and sets its associated file.

Parameters:
file - the filename of the template to load

Method Detail

hgcommon.php at line 618

set

public void set(string key, string value)

Sets a value for replacing a specific tag.

Parameters:
key - the name of the tag to replace
value - the value to replace

hgcommon.php at line 627

output

public string output(str str_template)

Outputs the content of the template, replacing the keys for its respective values.


hgcommon.php at line 657

merge

public static string merge(array templates, string separator, str str_template)

Merges the content from an array of templates and separates it with $separator.

Parameters:
templates - an array of Template objects to merge
separator - the string that is used between each Template object

higrid.net