带有自定义Prestashop模块的路径问题

带有自定义Prestashop模块的路径问题,prestashop,Prestashop,有人能帮我解决自定义Prestashop module 1.6版本中遇到的文件路径问题吗 以下内容在本地主机环境中非常有效: return $this->display(__FILE__, '../../product-list.tpl'); 但是,在实时服务器上不起作用。以下方法确实有效: return $this->display(__FILE__, '../../themes/default-bootstrap/product-list.tpl'); 这是不可接受的,因为有

有人能帮我解决自定义Prestashop module 1.6版本中遇到的文件路径问题吗

以下内容在本地主机环境中非常有效:

return $this->display(__FILE__, '../../product-list.tpl');
但是,在实时服务器上不起作用。以下方法确实有效:

return $this->display(__FILE__, '../../themes/default-bootstrap/product-list.tpl');
这是不可接受的,因为有些客户不会使用默认的引导主题

对此问题的任何帮助都将不胜感激

感谢

“$this->display”命令对ModuleCore有许多依赖关系,因此最好在自定义tpl文件中使用include:

return $this->display(__FILE__, 'views/templates/custom.tpl');
然后在custom.tpl上:

{include file="$tpl_dir./product-list.tpl" products=$products}

感谢您的快速回复,但该链接来自自定义模块的php,用于显示位于themes/default bootstrap文件夹中的product-list.tpl$tpl_dir是prestashop上预定义的smarty变量,等于主题目录地址再次感谢您的帮助,但是$tpl_dir对我的问题没有帮助。