CodeIgniter - 在发送到浏览器之前编辑输出缓冲区?
我正在研究 PHP 框架 CodeIgniter。在将输出刷新给用户之前,我需要一些有关编辑输出的帮助。
通常在 PHP 中,您只需使用 ob_start();
然后使用 ob_get_clean();
即可检索内容。
不过,在阅读 CodeIgniter 文档时,他们说所有输出都已缓冲。
有人经历过无意中启动第二个 ob_start()
吗?或者,任何人都可以谈论 CodeIgniter 输出缓冲,以便我可以编辑它吗?
I'm researching the PHP framework CodeIgniter. I need some help regarding editing the output before it's flushed to the user.
Usually in PHP, you can just use ob_start();
and then ob_get_clean();
to retrieve the contents.
While reading the CodeIgniter documentation, though, they say all output is already buffered.
Has anybody experience with unintentionally starting a second ob_start()
? Alternatively, can anyone talk about the CodeIgniter output buffering so I may edit it?
据我所知,它是由 CodeIgniter 自动处理的,除非您自己手动指定输出方法。看:
http://ellislab.com/codeigniter/user-guide/general/controllers .html#output
(也祝贺你决定使用 CodeIgniter,我对这个框架还不够了解!)
As far as I know it's handled automatically by CodeIgniter, unless you manually specify the output methods yourself. See:
http://ellislab.com/codeigniter/user-guide/general/controllers.html#output
(also congrats on deciding to use CodeIgniter, I can't get enough of this framework!)