[Catalyst] accessing action methods in a TT view

John Napiorkowski jjn1056 at yahoo.com
Thu Jul 13 16:38:25 CEST 2006


Quite often I create non action methods in my controllers to centralize functions that don't need to be an action.  Stuff like building up a HTML::Widget form, etc.  Usually in the controller I call it with $self->local_method(...) and so forth.

Now in the TT view you have the stash and the context but I find no easy way to access the $self->xxx stuff. I know it can be considered bad form to have too much interaction between your template and your logic, but I do have uses for this.  Usually I just do something like $c->stash->{self} = \$self;  whereever I need it but this get's awefully redundant and makes my FRY ruby friends snicker at me.

Has anyone run into this issue and discovered a better solution?  I thought about putting something in a custom end action as a solution but maybe someone out there came up with something better (and can share it for posterity :) ).

--john





More information about the Catalyst mailing list