On 12/5/06, Nilson Santos Figueiredo Junior <[EMAIL PROTECTED]> wrote:
IMO, the real thing that's missing is Perl code layer between the
controller and the template, i.e., the view should be composed by code
+ templates. If you don't do it this way you need to either a) put
code which belongs to the view inside your controller, b) write large
amounts of code in your templates using and reap *all* the great
benefits that come along with large chunks of code written in TT
language or c) write a TT plugin.
"a" is fundamentally wrong, "b" will give you nightmares, "c" is
arguably clumsy and not practical at all.
Actually, someone could come up with a view class which would first
call some Perl code and then process the TT template.
Why not override MyApp::View::MyView->process() and put your Perl code
layer in there? What I do is have ->process() build up pieces of HTML,
like tables, forms, etc, with whatever external module I see fit,
based on the stash data. Then I stuff them back into the stash and use
the template only for layouting those pre-built pieces.
--
Eden Cardim
Instituto Baiano de Biotecnologia
Núcleo de Biologia Computacional e Gestão de Informações Biotecnológicas
Laboratório de Bioinformática
--
"you seem to think that 'close enough' is close enough...
please learn to be 'literal' around programming."
merlyn - on irc.freenode.net#perl
_______________________________________________
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/