On 12/5/06 8:51 PM, Nilson Santos Figueiredo Junior wrote: > On 12/5/06, John Siracusa <[EMAIL PROTECTED]> wrote: >> What would this "Perl code layer" be responsible for doing? Can you give >> some examples? >> > The most obvious example is data set sorting. The sort order is something > presentation related and, thus, shouldn't be in your controller (at least from > my POV).
I'd say that's borderline. It could be viewed as "arranging the data" but it could also be viewed as an inherent property of the data, e.g., in the case of a top ten list. (And practically speaking, it's usually much more efficient to let the database do the sorting.) Can you give another example? My stance has always been that I don't mind "code" in templates so long as the sole purpose of that code is to layout and format the data. IOW, a view should never retrieve, create, or modify data. It should just move around and format what it's been given. Now I suppose I could limit myself to a simple subset of a templating language and then push off all the "code" parts of the view to a Perl module, but I'm still not sure what that'd buy me, which is why I'm asking for examples. > I believe that the real benefit would be not being restrained to what TT can > and cannot do while reaping the benefits of using templates. I think they call that "Mason" ;) -John _______________________________________________ List: [email protected] Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst Searchable archive: http://www.mail-archive.com/[email protected]/ Dev site: http://dev.catalyst.perl.org/
