|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
yankee Smarty Rookie
Joined: 02 Mar 2009 Posts: 31
|
Posted: Mon Jun 15, 2009 9:50 pm Post subject: $smarty->minifyXml = true |
|
|
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 |
|
|
|
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
|