且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用Smarty 3,代码Igniter 2和HMVC连同smarty的继承?

更新时间:2023-11-19 18:01:40

解决方案,

My_Parser.php 中编辑第30行的块,如下所示:

in My_Parser.php edit the block at line 30 so it reads:

// Modular Separation / Modular Extensions has been detected
if (method_exists( $this->CI->router, 'fetch_module' ))
{
    $this->_module  = $this->CI->router->fetch_module();
    //add the current module view folder as a template directory
    if ($this->_module !== '')
        $this->CI->smarty->addTemplateDir(APPPATH."modules/".$this->_module.'/views');
}

这种方法的一个缺点是smarty会查看你的应用程序/视图文件夹之前的模块查看文件夹。如果有人知道一个解决方案,那将是太棒了。

The one drawback of this method is that smarty will look in your application/views folder before the module views folder. if someone knows a solution to that then it would be fantastic.