[Catalyst] Calling a private sub - best practice
RA Jones
ra.jones at dpw.clara.co.uk
Wed Mar 14 16:50:10 GMT 2007
Adam Jacob wrote:
> On Mar 14, 2007, at 9:23 AM, RA Jones wrote:
>> Is this the correct way to call sub-routines, via $c->forward and
>> $c->stash? I know about TIMTOWTDI but I want to start off with 'best
>> practice'.
>
> You can forward $c, which will let you call the form object directly.
>
> Adam
Doesn't $c get forwarded automatically? All Catalyst methods seem to
begin with my ($self, $c) = @_;
I tried this: my $form = $c->forward('build_form'); which forwards to
the build_form() method which (of course) builds and returns the form.
It does work - is that what you had in mind?
--
Richard Jones
Leeds, UK
mailto:ra.jones at dpw.clara.co.uk
More information about the Catalyst
mailing list