zoukankan      html  css  js  c++  java
  • 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!

    改了模板:cmsCoreLibraryVendorSmartysysplugins下的  smarty_internal_template.php

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

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

    }

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

  • 相关阅读:
    算法中时间复杂度概括——o(1)、o(n)、o(logn)、o(nlogn)
    Docker笔记
    struts框架
    引包问题
    官网下载
    WebService
    答辩问题整理
    小程序转发功能的实现
    小程序自定义组件及传值
    vue 点击下拉框
  • 原文地址:https://www.cnblogs.com/wuling129/p/4745245.html
Copyright © 2011-2022 走看看