Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

$smarty->minifyXml = true

 
Post new topic   Reply to topic    Smarty Forum Index -> Smarty 3
View previous topic :: View next topic  
Author Message
yankee
Smarty Rookie


Joined: 02 Mar 2009
Posts: 31

PostPosted: Mon Jun 15, 2009 9:50 pm    Post subject: $smarty->minifyXml = true Reply with quote

Hi @ll,

smarty is often used to generate x(ht)ml. Keeping templates readable is very important and thus idention is very important as well, even though these indentions are ignored by the browser anyway.
To save bandwith and to decrease loading times it would make sense to discard these indentions and linebreaks.
This is something nobody sane will ever do without a template engine. Implementing this as output filter causes high cpu loads and minifying before template execution is complex since it needs awareness of the template language.

Smarty could do that while compiling the template.

Of course it would be very cool to minify JavaScript as well:
Code:
{javascript}
var hello = 'world';
var pointless = true;
if (pointless == true)
{
  alert('This is pintless');
}
else alert(hello);
{/javascript}

Results in:
Code:
{javascript}
var hello='world';var pointless=true;if(pointless==true)
{alert('This is pintless');}
else alert(hello);
{/javascript}
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Smarty 3 All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP