|
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 |
Darker Smarty n00b
Joined: 19 Apr 2012 Posts: 3
|
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Mon Jan 12, 2015 3:36 pm Post subject: |
|
|
The topic you linked claims compatibility with Smarty3.
Though, I fail to see the "awesomeness" of such plugin. If you need such a convoluted logic, you probably did not gave your templates a thought.
The view logic must be very simple. |
|
Back to top |
|
Darker Smarty n00b
Joined: 19 Apr 2012 Posts: 3
|
Posted: Mon Jan 12, 2015 3:59 pm Post subject: |
|
|
Switch is much simpler to read than bunch of else/if commands. This is why switch exists in programming languages as you probably fail to see.
And you often happen to have several states certain part of site may display.
Anyway I just noticed the version 3 should be here but the download is missing... |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Tue Jan 13, 2015 3:27 am Post subject: |
|
|
Template is not a program.
If you need complex programming in template, you're diminishing the very idea of MVC principle.
Template should not include business logic. |
|
Back to top |
|
Darker Smarty n00b
Joined: 19 Apr 2012 Posts: 3
|
Posted: Tue Jan 13, 2015 7:18 am Post subject: |
|
|
Once again, seems you take a long time to understand this:
switch was invented to replace long unreadable chains of if/else statements. This is no complicated program logic. This is about making code more readable. If you have problem with {switch}, you should also dislike {if}, not talking about {section} and {foreach} which are both more complex than {switch}.
Beside from that for the given task I see no other solution - and neither do you, otherwise you'd mention it. You probably feel smart chaining {if}s instead. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
|
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
|