Tim Colson wrote:
Exactly. The thing is trivial to read and understand

Trivial, eh? Heh heh, well so trivial that you then present a null versus empty case... and dismiss it because it's probably "less common". ;-)

It is "trivial to read and understand" *AS PRESENTED*.

In the null vs. empty case, a more powerful concept which WOULD NOT WORK using the "trivial to read and understand syntax" this in not the case.

May I introduce you to "intelligent" views: they tell you when they were fed invalid data.

The view isn't doing it... the Velocity Engine is making the call. That's my concern.

Conceptually. Sure, the view is being produced by V, but it's still a view, in M/V/C terminology: it has no logic. It's just being a particularly useful view, rather than a weak one.



But it does bring up another use case that this swank new #foreach/#else doesn't handle.

Tables.

#if ($SHOW_RESULTS)
<TABLE>
#foreach ($thingy in $results) $thingy
#end
</TABLE>


#else
No soup for you!
#end


Point is -- you need to put in the magic "do results exist" test outside the
foreach... so your #else won't help you here, and you'll end up with dual
logic anyway. <grin>
>

We use:

<table>
<tr>
headers row
</tr>
#foreach
   do all the rows
#else
   <td colspan="5"> No results found </td>
#end

(used my proposed syntax for conveninece, but you get the idea :)).

It looks nice: it shows you what information you would have had, had there been any information.

I agree we shouldn't invent the same things... but the trick is that we all
must have the same, exact, identical wheel.

Which is why I asked. So far, you've not convinced me otherwise :).

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to