solegaonkar has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks! Need some help with Catalyst framework I have an application that uses Catalyst. The Root.pm controller performs some checks before passing it over to the tt2. I need to skip this for some pages. But, I am not able to identify the target view tt2 in the root controller. Can you please help!

Replies are listed 'Best First'.
Re: Catalyst Framework - target tt2 view
by rnewsham (Curate) on Sep 18, 2014 at 09:00 UTC

    If you want to change the view for a page/method inside a controller you can do this.

    $c->stash->{current_view} = 'OTHER_VIEW';
Re: Catalyst Framework - target tt2 view
by Your Mother (Archbishop) on Sep 18, 2014 at 15:46 UTC

    Besides changing the view, as suggested, if you’re using sub end : ActionClass('RenderView') {}, Catalyst::Action::RenderView—and you probably should be—then all you have to do is write something to the body and the view processing will be skippped. E.g.–

    sub moo : Local Args(0) { my ( $self, $c ) = @_; $c->response->body("OHAI, COW!"); }