How to remove tabs, line breaks, unneeded spaces, etc?
I am trying to save a little bandwidth by removing line breaks, tabs, unneeded spaces, etc. that you would see in a browser's view source. Is there a way of doing this when I'm using a php free template class?
Example:
Google.com. If you view their source, the code is cropped.
Info:
I have read some information regarding php's ob_start but I am not sure if that would apply to me as the examples I've seen echo's the buffer, whereas the template class is derived from phpbb and it has it's own $template method to make the output.
Example of method I use:
$tpl->set_filenames(array(
'body' => 'index.tpl')
);
$tpl->loadfile('body');
$tpl->pparse('body');
My HTML code is in index.tpl, and the PHP code is in index.php. The $tpl call's the template class and builds the page on pparse.
Additional Details
9 months ago
Jan: php.net does not have a forum, and I am hoping someone here might know!
Cva: That is bad advice! The way it is suppose to be done is proccessing the output, while leaving the original code untouched, as it should.
|