谁帮我写一个smarty配置文件啊? 这是目录结构,smarty放置在common文件夹下面,我希望user下可以放置php文件,如图写的稍微详细一点,最好是有点注释,新手,谢谢! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 include "../libs/Smarty.class.php"; $NowPathArray=explode("test",str_replace("\\","/",dirname(__FILE__))) ; @define("root_path", $NowPathArray[0]); @define('__SITE_ROOT', root_path."test"); $tpl = new Smarty(); $tpl->template_dir = __SITE_ROOT . "/templates/"; $tpl->compile_dir = __SITE_ROOT . "/templates_c/"; $tpl->config_dir = __SITE_ROOT . "/configs/"; $tpl->cache_dir = __SITE_ROOT . "/cache/"; $tpl->left_delimiter = '<{'; $tpl->right_delimiter = '}>'; 路径 需要你 根据实际情况而定 难道是这样;D:.├─common│ └─smarty│ ├─internals│ └─plugins└─user ├─templates └─templates_c └——demo2.phpdemo2.php<?phprequire_once('../common/smarty/Smarty.class.php');$smarty = new Smarty();$smarty->compile_dir=dirname(__FILE__)."/templates_c";$smarty->template_dir=dirname(__FILE__)."/templates";$smarty->caching=false; $smarty->left_delimiter="<{";$smarty->right_delimiter="}>"; $smarty->assign("abc","eeeeeeee");$smarty->display("demo2.tpl"); 求助 关于类的问题 救助这个SQL语句怎么写。。 js无法post关联数组到php? webservice奇怪问题,急急急 mysql---这样的结构怎样排序??? 模板之我见 php session_id用法,请指点。~ 系统服务和非系统服务有何区别 请教一个关于php session 的问题 将php中的数据传递到JS中,然后在网页中显示出来 sqlite_fetch_array 执行完了怎么表也没有了 PHP数组转字符串怎么转
$NowPathArray=explode("test",str_replace("\\","/",dirname(__FILE__))) ;
@define("root_path", $NowPathArray[0]);
@define('__SITE_ROOT', root_path."test");
$tpl = new Smarty();
$tpl->template_dir = __SITE_ROOT . "/templates/";
$tpl->compile_dir = __SITE_ROOT . "/templates_c/";
$tpl->config_dir = __SITE_ROOT . "/configs/";
$tpl->cache_dir = __SITE_ROOT . "/cache/";
$tpl->left_delimiter = '<{';
$tpl->right_delimiter = '}>'; 路径 需要你 根据实际情况而定
├─common
│ └─smarty
│ ├─internals
│ └─plugins
└─user
├─templates
└─templates_c
└——demo2.php
demo2.php<?php
require_once('../common/smarty/Smarty.class.php');
$smarty = new Smarty();
$smarty->compile_dir=dirname(__FILE__)."/templates_c";
$smarty->template_dir=dirname(__FILE__)."/templates";
$smarty->caching=false;
$smarty->left_delimiter="<{";
$smarty->right_delimiter="}>";
$smarty->assign("abc","eeeeeeee");
$smarty->display("demo2.tpl");