0

我在搜索模块中遇到了这个语法错误。有人可以调查一下这是什么问题。

// This is the path to the fts_instant_product_search.php file you uploaded.
{php}$x=parse_url($GLOBALS['smarty']->_tpl_vars['current_location']);$GLOBALS['smarty']->assign('searchPath',$x['path']);{/php}
searchPath = "{$searchPath}/";

它会产生此错误:

PHP 致命错误:未捕获 --> Smarty 编译器:第 79 行“{php}$x=parse_url($GLOBALS[ 'smarty']->_tpl_vars['current_location']);$GLOBALS['smarty']->assign('searchPath',$x['path']);{/php}" 未知标签 "php" <- - 在第 79 行抛出 /home/xxx/public_html/xcart475/include/lib/smarty3/sysplugins/smarty_internal_templatecompilerbase.php

4

1 回答 1

1

X-Cart 4.7.5 使用 Smarty 3.1 版,不允许使用 {php} 标签: http ://www.smarty.net/docs/en/language.function.php.tpl

重要通知

{php} 标签已从 Smarty 中弃用,不应使用。将您的 PHP 逻辑放在 PHP 脚本或插件函数中。

从 Smarty 3.1 开始,{php} 标签仅可从SmartyBC 获得

您的选择是:

  1. 联系皮肤开发者并要求他们更改皮肤代码,使其符合 smarty 3.1
  2. 从此处安装上述向后兼容性包装器: http ://www.smarty.net/docs/en/bc.tpl
于 2016-06-22T14:57:50.290 回答