Location: PHPKode > projects > Pine template > pine_template-2008-01-12/example.php
Created by Andras Zoltan-Gyarfas from Transilvania
email: hide@address.com
Use this script as you wish, just please send a notice for me if you do so.
For more questions, please contact me.

// include the class file

//initialize the class:
$tpl = new tpl;

Load the template file. The tpl::load method can take over a filename, or a string as a template
The template file must contain strings included betwen { and } which will be changed with the target string.


$cont['title']= "Page title";
$cont['header']= "\n\t<link rel=\"SHORTCUT ICON\" href=\"favicon.ico\" type=\"image/x-icon\" />
\n\t<link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\" />\n";
$cont['content']= "<strong>Page content</strong>";

This method changes the strings in the template.
It takes over an associative array whit the keys as the strings included between { and } in the template file and values as the sting to chamge

returns the site string to display

Display the taken over string. Before it returns the site, it will clear the unchanged {NAME} format strings
echo $tpl->display($tpl->get_c());
Return current item: Pine template