Re: [PHP Template] Re: if statements

[email protected] (Monte Ohrt)
Newsgroups php.template
Organization ispi
Message-ID <[email protected]>
Tobias Ratschiller wrote:
> 
> > Then the developer would need to explicitly hide one of the sections.
> > And what if there is another place on the page where some output will
> > depend on where products_total is greater than 5, for example? Another
> > effort on part of developer is needed.
> >
> > So, what are your thoughts? Are 'if' statements good or evil?
> 
> For me, if-statements should remain in the application logic. I'm trying to
> save my designer from the need to write things like this, after all.
> 
> Your example could easily be written as
> "Your search found {products_total} {matches}", and the app logic determines
> whether it should be "match" or "matches".
> 
> -Tobias

This works great *if* the developer knows exactly what is needed on the
page before hand. But more times than not, the designer likes to shuffle
things around and try different ideas on thier own, and supporting IF
logic supplies this flexability. This also helps the designer to think
more freely about a template design, they will be reluctant to try
different things if they have to keep tapping the shoulder of the
developer.

Monte
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.