php smarty模板路径,PHP,Smarty:检查不同文件夹中的模板

在Smarty.class.PHP中,方法Smarty :: _ parse_resource_name():

foreach ((array)$params['resource_base_path'] as $_curr_path) {

$_fullpath = $_curr_path . DIRECTORY_SEPARATOR . $params['resource_name'];

if (file_exists($_fullpath) && is_file($_fullpath)) {

$params['resource_name'] = $_fullpath;

return true;

}

// didn't find the file,try include_path

$_params = array('file_path' => $_fullpath);

require_once(SMARTY_CORE_DIR . 'core.get_include_path.PHP');

if(smarty_core_get_include_path($_params,$this)) {

$params['resource_name'] = $_params['new_file_path'];

return true;

}

}

$params [‘resource_base_path’]默认为Smarty :: _ fetch_resource_info()中的$this-> template_dir.

因此,您可以将$smarty-> template_dir设置为要查看的目录数组.请注意,这不会是递归的.这必须是未记录的功能.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值