* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published * by the Free Software Foundation; version 2 only. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * */ header('Content-type: text/html; charset=UTF8'); define('PATH_TO_CLASSES', '../administration/classes'); define('EXTENSION', '.php'); require_once PATH_TO_CLASSES . "/cls_db_mysql.php"; require_once PATH_TO_CLASSES . "/cls_fast_template.php"; require_once PATH_TO_CLASSES . "/cls_permissions.php"; $lang = !empty($_POST['lang']) ? $_POST['lang'] : 'pl'; require_once 'i18n/' . $lang . '/i18n.php'; $ft = new FastTemplate("./templates/" . $lang); $ft_path = $ft->get_root(); $ft->define('main', "main.tpl"); $ft->assign('CSS_HREF', $ft_path . "style/style.css"); $p = empty($_GET['p']) ? '' : $_GET['p']; switch ($p) { default: include "modules/main_content.php"; $ft->parse('MAIN', 'main'); } $ft->FastPrint(); exit;
<?php /** $Id: ex-parse_and_return.php,v 1.2 2005/06/15 19:37:15 vadim Exp $ * Demo of using FastTemplate::parse_and_return($template_name) method * start: Tue Feb 08 21:03:30 EET 2005 @835 /Internet Time/ * @author Voituk Vadim <voituk###asg.kiev.ua> */ require_once 'cls_fast_template.php'; $Template = new FastTemplate('templates/'); //NEW: New FastTemplate::define() - now supports array and name and value as parameter $Template->define('main', 'ex-parse_and_return.html'); $Template->assign('ADMIN', $_SERVER["SERVER_ADMIN"]); $Template->assign(array('TEMPLATE_ROOT' => $Template->get_root())); //NEW: New FT method - Parse template and return it as string print $Template->parse_and_return('main'); ?> <br><br><br> <B>This script source:</B> <I>See templates/ex-parse_and_return.html for more info</I><br> <?php highlight_file($_SERVER["PATH_TRANSLATED"]); ?>