[Catalyst] accessing action methods in a TT view

Rodney Broom rbroom+catalyst at rbroom.com
Fri Jul 14 03:16:03 CEST 2006


From: "Guillermo Roditi" <groditi at gmail.com>

> whatabout $c->controller()

That appears to work, thanks. The remaining cludge I've got in my code is carrying around the context. So far, I only need this for access to the stash. For intance, in my view:

  sub process {
    my $self = shift;
    my $c = shift;
    $self->{_app} = $c; # Save for $c->stash access later
    ...
    $self->NEXT::process($c, @_);
  }

I'm sure this is a situation of me not having read enough docs. Though, it seems odd that the context object would get passed in if I could just say something simple like $self->context. Of course, I'd settle for $self->stash. :)

---
Rodney Broom





More information about the Catalyst mailing list