Yes, the tool approach is very nice, and i would favor that.
But explicitly adding to
the context in my opinion is a breach of MVC, as the coloring
is entirely a rendering issue.  It has nothing to do with the
interaction of the data and the view, which is what the controller
is responsible for.

-----Original Message-----
From: Nathan Bubna [mailto:[EMAIL PROTECTED]
Sent: Monday, May 03, 2004 11:00 AM
To: Velocity Developers List
Subject: Re: Foreach cycle


Inger, Matthew said:
> Yes, it could.  However, in the example as below, it's
> completely a rendering issue, and therefore, the controller
> should not be placing that kind of thing in the context,

i think it is very appropriate for the controller to make available the both
the functions (i.e. tools) and data necessary for rendering.

> as it's completely up to the view creator to decide those things.
> It should be available to be instantiated from the view.

if you use the velocity-tools, you can make the tool globally available and
ready-to-use in all your templates.  very, very simple and designer
friendly.

> -----Original Message-----
> From: Konstantin Priblouda [mailto:[EMAIL PROTECTED]
...
> --- "Inger, Matthew" <[EMAIL PROTECTED]> wrote:
> > Why not just have a directive for this, as it's
> > probably
> > a common functionality (similar to what webmacro
> > does)
> >
> > #alternate ( $color through [ "red", "blue" ] )
>
> This can be achieved by simple bean placed in context.
...

Nathan Bubna
[EMAIL PROTECTED]


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

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

Reply via email to