Re: [PHP Template] Re: if statements

From: Date: Tue, 15 Feb 2000 22:11:46 +0000
Subject: Re: [PHP Template] Re: if statements
References: 1 2  Groups: php.template 
Request: Send a blank email to php-template+get-56@lists.php.net to get a copy of this message
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

« previous php.template (#56) next »