【发布时间】:2012-06-22 02:35:27
【问题描述】:
我正在使用 Code Igniter、HMVC library 和 Smarty 和 this library。
Smarty 默认工作正常,但是如果我尝试使用 smarty 的继承功能 ({extends file="master.tpl"}) 就会遇到问题。
扩展功能不会在模块视图文件夹中查找扩展文件(在上述情况下为master.tpl),而是仅在application/views/ 文件夹中查找,如果找不到则抛出错误。
我可以将 APPPATH."modules/smartytest/views" 添加到 smarty 配置文件中的 $config['template_directory'] 数组中。但这会为它首先检查文件的数组中的每个项目引发错误。 filemtime(): stat failed for application/views/master.tpl
还有一个额外的问题,如果我有三个模块,所有的数组和模块都有一个 master.tpl,那么无论我从哪个模块调用扩展,它都会加载找到的第一个。
那么,有没有办法让 smarty 的扩展函数与 HMVC 模块很好地配合?
【问题讨论】:
标签: php codeigniter extend hmvc smarty3