【发布时间】:2011-01-26 02:31:28
【问题描述】:
我早就料到了
类 Default_Plugin_Test 扩展 Zend_Controller_Plugin_Abstract { 公共函数 preDispatch($request) { Zend_Controller_Front::getInstance()->setParam('disableOutputBuffering', true); } }还会禁用与操作关联的视图中的缓冲,但不会。
即使在视图中禁用输出缓冲似乎也是不可能的,因为它是硬编码的:
抽象类 Zend_View_Abstract 实现 Zend_View_Interface { /** * 处理视图脚本并返回输出。 * * @param string $name 要处理的脚本名称。 * @return string 脚本输出。 */ 公共函数渲染($名称) { // 使用父私有方法查找脚本文件名 $this->_file = $this->_script($name); 未设置($名称); // 从本地范围中删除 $name ob_start(); $this->_run($this->_file); 返回 $this->_filter(ob_get_clean()); //过滤输出 } }有没有人有类似的经历,或者有解决方案?
【问题讨论】:
-
我能知道你为什么需要禁用输出缓冲