Converted PHPLIB Template class
For those who want to use PHPLIB's fine template class, here's a PEAR conforming class with the original PHPLIB template code from phplib-stable CVS. Original author was Kristian Koehntopp <kris@koehntopp.de>
Located in /smarty/plugins/menuLayer/lib/PHPLIB.php (line 28)
If set, echo assignments
$file[handle] = "filename";
fallback paths that should be defined in a child class
"yes" => halt, "report" => report error, continue, "no" => ignore error quietly
Relative filenames are relative to this pathname
"remove" => remove undefined variables
"comment" => replace undefined variables with comments "keep" => keep undefined variables
The last error message is retained here
$_varVals[key] = "value";
Constructor
Finish string
Get finished variable
Get undefined values of a handle
Return one or more specific variable(s) with their values.
Return all defined variables and their values
Error function. Halt template system with message to show
printf error message to show
Print variable to the browser
Parse handle into target
Parses handle $handle into $target, eventually appending handle at $target if $append is defined as TRUE.
Same as parse, but printing it.
Same as subst but printing the result
Set a block in the appropriate template handle
By setting a block like that:
<!-- BEGIN blockname --> html code <!-- END blockname -->
you can easily do repeating HTML code, i.e. output database data nice formatted into a HTML table where each DB row is placed into a HTML table row which is defined in this block. It extracts the template $handle from $parent and places variable {$name} instead.
Set appropriate template files
With this method you set the template files you want to use. Either you supply an associative array with key/value pairs where the key is the handle for the filname and the value is the filename itself, or you define $handle as the file name handle and $filename as the filename if you want to define only one template.
Sets the template directory
What to do with unknown variables
three possible values:
Set corresponding substitutions for placeholders
Substitute variables in handle $handle
Documentation generated on Wed, 05 Oct 2011 10:36:42 +0200 by phpDocumentor 1.4.1