[Catalyst] question from tutorial - does creating HTML in a controller using HTML::Widget violate MVC?

Nilson Santos Figueiredo Junior acid06 at gmail.com
Wed Dec 6 21:27:18 GMT 2006


On 12/6/06, Eden Cardim <edencardim at gmail.com> wrote:
> 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.

I don't want some generic code that'd be used by all actions (well,
actually, I might want that *too*), I want to have Perl code specific
to each action. Using you approach I'd need to redirect to the
specific view in every request which is clumsy.

Others have suggested Mason, but I don't want Perl code *inside* my
templates. I want Perl code in my views, but I also want to have
separate templates.

-Nilson Santos F. Jr.



More information about the Catalyst mailing list