曜日晨阳 发表于 2012-10-26 20:50:16

HMVC(wiredesignz)+Template(philsturgeon)使用Modules:run()无法正常使用...

本帖最后由 曜日晨阳 于 2012-10-26 20:53 编辑

最近在项目中使用HMVC和template组件的时候,发现使用HMVC中Modules::run()方法跨控制器输出$this->template->build()时结果为NULL的问题。经过一些尝试,找到了一个fix该问题的方案。希望能帮到有同样问题的同学。

HMVC:https://bitbucket.org/wiredesignz/codeigniter-modular-extensions-hmvc/downloads
Codeigniter-Template : https://github.com/philsturgeon/codeigniter-template

步骤:

1、打开HMVC目录中MX/Modules.php文件
2、在第75行附近找到:
$buffer = ob_get_clean()
;3、在其下面加入:
if($output === NULL && $buffer === ''){
      $output = CI::$APP->output->get_output();
}
搞定。

这样在Modules::run() 方法来输出使用 $this->template->build()进行视图构造的控制器了。

yuvista 发表于 2012-10-27 14:55:31

受教了 感谢晨阳

josh 发表于 2013-1-30 15:09:14

There are no files available to download.

曜日晨阳 发表于 2013-1-30 17:23:02

josh 发表于 2013-1-30 15:09 static/image/common/back.gif
There are no files available to download.

this issues don't need to download any file
页: [1]
查看完整版本: HMVC(wiredesignz)+Template(philsturgeon)使用Modules:run()无法正常使用...