Location: PHPKode > projects > Pine template > pine_template-2008-01-12/example.php
<?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
include("./template.lib.php");

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

/*
tpl::load
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.
*/

$tpl->load("./index.tpl");

$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>";

/*
tpl::change_array($cont)
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
*/
$tpl->change_array($cont);

/*
tpl::get_c()
returns the site string to display

tpl::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