日期:2014-05-17 浏览次数:20475 次
<?php include_once './libs/Smarty.class.php'; $tpl=new Smarty; $tpl->left_delimiter="<!--{"; $tpl->right_delimiter="}-->"; ?>
<?php require_once 'init.inc.php'; $title="this is a title"; $content="this is my content"; $tpl->assign("title",$title); $tpl->assign("content",$content); $tpl->display("default/test.tpl"); ?>
<?php include_once './libs/Smarty.class.php'; class mySmarty extends Smarty{ function mySmarty(){ $this->Smarty(); $this->template_dir="./templates/"; $this->compile_dir="./templates_c/"; $this->config_dir="./configs/"; $this->cache_dir="./cache/"; $this->caching=true; $this->left_delimiter="<!--{"; $this->right_delimiter="}-->"; $this->assign('app_name','mySmartyTest'); } } ?>
<?php require_once 'init.inc.php'; $tpl=new mySmarty; $title="this is a title"; $content="this is my content"; $tpl->assign("title",$title); $tpl->assign("content",$content); $tpl->display("default/test.tpl"); ?>