Location: PHPKode > scripts > Pine template > pine-template/example.php
<?php
/*
Created by Andras Zoltan-Gyarfas from Transilvania in 2007
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; // * this is optional

$cont['title']= "Page title";
$cont['header']= "\n\t<link rel=\"SHORTCUT ICON\" href=\"favicon.ico\" type=\"image/x-icon\" />\n<link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\" />\n";
$cont['content']= "<strong>This is the page content</strong>";
/*
tpl::display($cont, $wh)
This method loads all the data needed for the class. The first argument is an associative array with the keys as the strings included between { and } in the template file and values as the sting to chamge. The second argument can be a valid filename of the template, or a string containing the loaded template. This argument must contain strings included betwen { and } which will be changed with the target string from the first argument. Before it returns the site, it will clear the unchanged {NAME} format strings.
*/
$ret = tpl::display($cont, "./index.tpl");
/*
Display the result string.
*/
echo $ret; ?>
Return current item: Pine template