5

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?

1
  • 2
    in php you can have more than one buffer at the same time. starting a second buffer, then outputting the content would put that output into code igniters original buffer. basically code igniters buffer should not affect yours. chances are that you would not want to edit output buffers however since that is slow. better would be to edit content before it is stored on your server. Commented May 5, 2011 at 17:04

1 Answer 1

5

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!)

Sign up to request clarification or add additional context in comments.

3 Comments

The link you provided (Linking to the output feature) gives me the opportunity to edit the output before it's sent. That's what I want! Sweet! Thank you very much!
the link is invalid for now
@AhmadAzwarAnas yeah seems EllisLab decided to change the URL without setting up any redirects. Bad practice! Updated my answer to the new URL now.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.