Re[2]: [SMARTY] switch statement ?
| From: | Bertrand DUNOGIER | Date: | Mon, 29 Apr 2002 09:20:58 +0000 |
| Subject: | Re[2]: [SMARTY] switch statement ? | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-3918@lists.php.net to get a copy of this message | ||
RM> Why do you want to stuff a lot of functionality into the templates? It seems
RM> to me that it would be a bad case of mixing the functionality and
RM> presentation layer.
RM> A lot of the requests on this list seems to be aimed at getting more and
RM> more functionality into the template system (e.g. the PDF discussion). I
RM> regard this as very wrong - you'll end up putting developer/designer layer
RM> on top of PHP, and then you'll need a new layer on top of Smarty, to provide
RM> the designers with a (somewhat) clean interface...
I'm not a begginer programmer, you know :)
I just notice that i happen to have some
{if ...}
...
{elseif}
...
{elseif}
...
{else}
...
{/if}
statements. And this is typically what can be replaced by a switch
with a good increase in code quality.
And since this is handled on template compilation time, it doesn't
harm the site's response time.
But never forget that in my opinion, this is not something that html
designers can handle easily. On the other hand, html designers can't
be full templates designer unless they have some coding knowledges,
so...
and a switch / case is not harder to understand than a if / elseif /
else is it ? :)
Thougts ?
Bertrand