anikwa Posted May 26, 2013 Share Posted May 26, 2013 Hi. I'm writing my own php framework for a couple of projects I'm doing and I'm currently writing the Render/Template class and I'm debating the use of ob_start(). Are there any practical benefits to using this? Quote Link to comment https://forums.phpfreaks.com/topic/278404-output-buffering/ Share on other sites More sharing options...
jcbones Posted May 26, 2013 Share Posted May 26, 2013 IMHO, output bufferings only good use is to cover up bad coding practices. Quote Link to comment https://forums.phpfreaks.com/topic/278404-output-buffering/#findComment-1432395 Share on other sites More sharing options...
anikwa Posted May 26, 2013 Author Share Posted May 26, 2013 What do you mean by that? Quote Link to comment https://forums.phpfreaks.com/topic/278404-output-buffering/#findComment-1432419 Share on other sites More sharing options...
trq Posted May 27, 2013 Share Posted May 27, 2013 There are plenty of benefits to using buffers in the context of template rendering. Having the ability to load template data into a specific scope without it displaying there and then is one of them. Quote Link to comment https://forums.phpfreaks.com/topic/278404-output-buffering/#findComment-1432452 Share on other sites More sharing options...
ignace Posted May 27, 2013 Share Posted May 27, 2013 Indeed output buffering is not a bad coding practice at all. That said certain PHP installations even have automatic output buffering enabled without having to write ob_start() anywhere. http://be2.php.net/manual/en/outcontrol.configuration.php#ini.output-buffering Quote Link to comment https://forums.phpfreaks.com/topic/278404-output-buffering/#findComment-1432575 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.