在CodeIgniter中集成Smarty和Module Extend

时间:2012-01-07 06:03:37

标签: codeigniter smarty hmvc

我是smarty框架的新手。我想用CodeIgniter创建一个集成smarty和模块扩展(MX)的项目。 我可以整合但不能回应我想要的东西。

当我在我的模块中运行Controller时,我的结果是“ApplicationFolder / ModulesFolder / Views / MyTemplateFile.tpl”中仅有效的模板文件。 但我想要的是它可以在“ApplicationFolder / Views / MyTemplateFile”中工作,而不是我的模块。

我在我的控制器中使用$ this-> parser-> parse(“views / MyTemplateFile.tpl”,$ data)显示空白页面。

先谢谢你,任何人都可以帮助我。

1 个答案:

答案 0 :(得分:0)

这个应该有效https://github.com/Vheissu/Ci-Smarty

在开发环境中,它会触发通知错误,所以我更改了这个文件 APPPATH/libraries/MY_Parser.php扩展MX_Loader,并将$_module修饰符更改为'protected'而非'private',一切正常

class MY_Parser extends MX_Loader {

protected $CI;
protected $theme_location;

protected $_module = '';

/* .... */
}
相关问题