Compressing output from a template
| From: | Markku Niskanen | Date: | Wed, 17 Nov 2004 13:42:53 +0000 |
| Subject: | Compressing output from a template | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-11970@lists.php.net to get a copy of this message | ||
I have a fairly complex template system for database
operations (browse/update/etc) which produces database
browser or update views on the 'work area' of the application.
At its worst (a HUGE form or a LONG list) the HTML output
from the fetch() is very big and it is getting even bigger due
to the indents in the templates for template readability.
What I do is basically this:
$formObject = new UpdateForm();
// create the form dynamically here...
...
$content = $formObject->fetchTemplate('updateform.tpl');
// I would like to 'compress' the $content string here
$mainSmarty->assign('content',$content);
What do you consider the safest and fastet way of 'trimming' the
string in the "content" so that it would remove all unnecessary
whitespace in the HTML string?
This is by far not a showstopper but it would be nice to make the
size of the HTML output as small as possible for some uses,
GPRS, for instance.
Markku