Location: PHPKode > projects > igloo opensource > xmods/simbio/GUI/template_parser/GUI_temp_sample.php
<?php
/*
GUI Template Parser class sample usage
*/

require_once 'GUI_template_parser.php';

$template_file = 'template.html';
// instantiate new template object
$template = new GUI_template_parser($template_file);

// put replacement string into variable
$page_title = 'Symbio GUI Template Parser Sample Usage';
$style_def = <<<STYLE
td {
font-family: verdana, arial, helvetica;
font-size: 12px;
color: navy;
}

.footer {
font-family: arial;
font-size: 14px;
color: navy;
}
STYLE;

$header = 'Symbio GUI Template Parser Sample Usage';
$left_content = 'This is the left content of template.';
$mid_content = 'This is the middle content of template.';
$right_content = 'This is the right content of template.';
$footer = '<b>Symbio</b> by YHA Team 2005';

// begin replacing marker with content
$template->assign('<!-- PAGE TITLE -->', $page_title);
$template->assign('<!-- STYLE DEFINITION -->', $style_def);
$template->assign('<!-- HEADER -->', $header);
$template->assign('<!-- LEFT CONTENT -->', $left_content);
$template->assign('<!-- MID CONTENT -->', $mid_content);
$template->assign('<!-- RIGHT CONTENT -->', $right_content);
$template->assign('<!-- FOOTER -->', $footer);

// print out the result
$template->printOut();

?>
Return current item: igloo opensource