[Catalyst] ActionClass('RenderView') questions

Tomas Doran bobtfish at bobtfish.net
Sun Mar 10 20:26:20 GMT 2013


On 5 Mar 2013, at 14:46, E R <pc88mxer at gmail.com> wrote:
> My use case is that I am developing a second view class, but it can't handle all of the templates yet. So the logic I am putting into the end method is:
> 
>   if (View2 can handle template $c->stash->{template}) {
>     $c->stash->{current_view} = 'View2';
>   }
> 
> This way I can incrementally test View2 as I add capabilities to it.

aha!

I'd handle this with a 3rd view, which just delegates to the 2nd view, then the 1st if the newer view doesn't like it..

This separates the 'do I call a view at all' logic - which you're happy with Catalyst's handling of, from the 'which of my views do I delegate to from _this request_' handling - which needs to be your own logic..

Cheers
t0m




More information about the Catalyst mailing list