> > And you would have to constantly
> > change that function then the template wants to display anything
> > diffrently.
>
> Yes, if the requirements change so that the template has to display
> different data, you would have to change your function.  That's a good
> thing, and I'll explain why I think that in a minute.

I agree but my never-ending quest for perfection led me to the original post
: )  Part of the reason I did post was for the same reasons presented by
Jonas.  I felt that for certain templates there could be a way to not
necessarily set callbacks but have variables initialized 'automagically' to
the appropriate data values when the template gets called.  This would be
useful for certain types of templates where the context is indifferent.  It
would also allow the separation between the model and view.  Each controller
would not necessarily have to be responsible for passing the same data to
the template which in turn would have to pass it to the 'widget'.

> > With callbacks, you can have general functions and can create lots of
> > varied templats without any customized code.
>
> That's what I used to think, but I ran into a lot of problems with this
> approach.  In the Java templating system I mentioned, we designed it
> with this in mind: we would have a set of components (like plugins) that
> could be called from any template.  They would take a few parameters,
> and designers could use them to make entirely new pages with no changes
> in our code.



Reply via email to