Public Method Details |
IntegratedTemplate |
public void IntegratedTemplate( [ string $root ] )
|
|
Builds some complex regular expressions and optinally sets the file root directory.
Make sure that you call this constructor if you derive your templateclass from this one.
|
Parameter |
|
string |
$root |
= >>""<< |
|
root directory, prefix for all filenames given to the object. |
|
Returns |
void |
See Also |
setRoot() |
|
get |
public string get( [ string $block ] )
|
|
Returns a block with all replacements done.
|
Parameter |
|
string |
$block |
= >>"__global__"<< |
|
of the block |
|
Returns |
string |
See Also |
show() |
|
parse |
public void parse( [ string $block ], boolean $flag_recursion )
|
|
Parses the given block.
|
Parameter |
|
string |
$block |
= >>"__global__"<< |
|
of the block to be parsed |
|
|
boolean |
$flag_recursion |
|
|
Warning: documentation is missing. |
|
Returns |
void |
See Also |
parseCurrentBlock() |
|
parseCurrentBlock |
public void parseCurrentBlock( )
|
|
Parses the current block
|
Returns |
void |
See Also |
parse(), setCurrentBlock(), $currentBlock |
|
setVariable |
public void setVariable( mixed $variable )
|
|
Sets a variable value.
The function can be used eighter like setVariable( "varname", "value")or with one array $variables["varname"] = "value" given setVariable($variables)quite like phplib templates set_var().
|
Parameter |
|
mixed |
$variable |
|
|
with the variable name or an array %variables["varname"] = "value" |
|
Returns |
void |
|
setCurrentBlock |
public boolean setCurrentBlock( [ string $block ] )
|
|
Sets the name of the current block that is the block where variables are added.
|
Parameter |
|
string |
$block |
= >>"__global__"<< |
|
of the block |
|
Returns |
boolean false on failure otherwise true |
|
init |
public void init( )
|
|
Clears all datafields of the object and rebuild the internal blocklist
LoadTemplatefile() and setTemplate() automatically call this functionwhen a new template is given. Don't use this functionunless you know what you're doing.
|
Returns |
void |
See Also |
free() |
|
free |
public void free( )
|
|
Clears all datafields of the object.
Don't use this function unless you know what you're doing.
|
Returns |
void |
See Also |
init() |
|
setTemplate |
public void setTemplate( string $template )
|
|
Sets the template.
You can eighter load a template file from disk with LoadTemplatefile() or set thetemplate manually using this function.
|
Parameter |
|
|
Returns |
void |
See Also |
LoadTemplatefile(), $template |
|
loadTemplatefile |
public boolean loadTemplatefile( string $filename, [ boolean $removeUnknownVariables, boolean $removeEmptyBlocks ] )
|
|
Reads a template file from the disk.
|
Parameter |
|
string |
$filename |
|
|
of the template file, full path! |
|
|
boolean |
$removeUnknownVariables |
= >>true<< |
|
unknown/unused variables? |
|
|
boolean |
$removeEmptyBlocks |
= >>true<< |
|
empty blocks? |
|
Returns |
boolean false on failure, otherwise true |
See Also |
$template, setTemplate() |
|
setRoot |
public void setRoot( string $root )
|
|
Sets the file root. The file root gets prefixed to all filenames passed to the object.
Make sure that you override this function when using the classon windows.
|
Parameter |
|
|
Returns |
void |
See Also |
IntegratedTemplate() |
|