[Phpwm] Site Structure

Iain Wallace iain at strawp.net
Fri Dec 9 16:04:51 GMT 2005


> I'm using that method at the moment, but I was under the impression it's
> just masking the problem and isn't an ideal solution. With output
> buffering, I'm still processing what shouldn't be processed, is that
> right?
>
>
Output buffering is really useful for certain situations, but IMO just
using it for keeping a template is a bit of a waste of memory and
processing (as lightweight as that may be).

The only time I've been forced to use output buffering has been situations
where I've needed to capture output from a function which outputs instead
of returns data (like var_dump) and I've really needed to not send headers
at that point.

It's also really good if you want to capture and manipulate a page on your
own site, you can start a buffer, include the page you want to capture,
and then stop the buffer - the page will then be in a variable ready for
you to throw regular expressions at it, etc. I saw this method used to
create mobile device output of a site using lightweight HTML or WML. Of
course, if the site was semantically marked up with lightweight HTML and
decent CSS they wouldn't have needed it at all, but then that's another
discussion ;)

Cheers,
Iain



More information about the Phpwm mailing list