Re: [PHP Template] Re: if statements

[email protected] (Monte Ohrt)
Newsgroups php.template
Organization ispi
Message-ID <[email protected]>
I don't think designers would have any problem with ELSE constructs, not
to mention they are quite handy to have around, it makes the IF logic
much cleaner in many cases. Since our SmartTemplate engine does not have
any ELSE constructs, it would be hard for us to know if a new designer
would have a problem with ELSE. I would think they can pick up on it
quite quickly, it falls into the same natural language category that IF
does:

{if: var = 1}
	do this
{else:}
	do this other
{/if}


Only two choices here, pretty straight forward. ELSEIF would be a bit
more confusing, but would it hurt to support? Our designers are
half-breed programmers anyways, so it wouldn't be much of a problem in
our case.


Monte

Sanford Redlich wrote:
> 
> I know I'll be sent to programmer's hell for this, but maybe "else" isn't
> necessary or a good idea anyway, again because the audience is the
> designers.  Having just the "if" statement forces the author to specify
> exactly the case under which the given formatting will be displayed.  This
> will be longer, but clearer, and then your "switch" statement equivalent
> becomes a direct extension of the normal syntax.  I know it will be clunky,
> but the clarity of intent and syntactic simplicity may make up for that.
> 
> Monte, what's your experience with the designers?  Which would they really
> prefer?  Especially the beginners?
> 
> Sanford
> 
> >I had real problems trying to support {else} construct in SmartTemplate,
> >so that's why you didn't see it in example. I will have to brainstorm on
> >how easy/hard it will be to parse 'if' statements.
> >
> >-Andrei
> 
> -------
> Sanford Redlich
> [email protected]
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.