|
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 |
hagman Smarty Rookie
Joined: 18 Apr 2003 Posts: 10 Location: Östersund, Sweden
|
Posted: Wed Jun 18, 2003 7:59 pm Post subject: Don't use plugins |
|
|
(Most) modifier plugins are just pointless.
is faster than
not much but when using alot of plugins more resourses is needed. _________________ php |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Wed Jun 18, 2003 8:09 pm Post subject: |
|
|
It won't be faster when your designer decides to replace all application bolded text (but not necessarily all instances of <b></b>) to something like <span style="font-decoration: underline;"></span>.
The whole point of abstraction is not to speed up runtime, but to help manage your development cycle. Remember, with caching, that still ends up as <b>whatever</b> in your output and in your compilation it is a straight function call to your plugin.
NOT POINTLESS. |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Wed Jun 18, 2003 8:20 pm Post subject: |
|
|
I agree that your particular example would be pointless... If all a modifier did was unconditionally wrap static tags around the variable then they surely would be pointless. However, the modifiers that come with Smarty typically adjust the variable content to some degree. Example:
{$title|upper}
This uppercases the variable. that's difficult to accomplish without a modifier or intervention from the application. So when you say most modifiers are pointless, I tend to disagree. I'd like to be shown which modifiers that come with Smarty are pointless.
Also, it is possible to make your example have a point to it by using for abstraction. Example:
{$var|bold}
This could be programmed to output one of the following depending on the browers capabilities:
<b>$var</b>
<span class="bold">$var</span>
Monte |
|
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
|