Smarty模板Windows下写代码 放到CentOS6.5无法正确解析

Smarty模板Windows下写代码 放到CentOS6.5无法正确解析

如题:报错:

Unable to load template file 'System/header.htm' in '/var/www/website/cms/Template/Default/Web/Index/index.htm'

结构如下:

Web/Index/index.htm

Web/System/header.htm

index.htm文件第一行如下:

{{include file="System/header.htm"}}

亲,你在windows下设置的路径放到linux下是不行滴!

在linux下不能正确解析相对路径。

后来php哥们给改了,偶刚开始还不会!5555!

改了模板:cms\Core\Library\Vendor\Smarty\sysplugins下的  smarty_internal_template.php

public function getSubTemplate($template, $cache_id, $compile_id, $caching, $cache_lifetime, $data, $parent_scope)
{
      // already in template cache?
     $template = '../'.$template;

      ..................

}

直接在原路径上加 “../”返回到上层路径再解析解决问题。

 

posted @ 2015-08-20 15:10 wuling129 阅读(...) 评论(...) 编辑 收藏

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值