[Catalyst-dev] bug: visit() calling end()

Peter Flanigan pjf at roxsoft.co.uk
Wed Mar 20 15:21:04 GMT 2013


On 20/03/13 09:11, David Schmidt wrote:
> I want to visit/forward to an action and that action is endpoint of a
> chain. so in order for the action to work correctly the entire chain
> has to be processed. How can I do that without using visit()?

So you have two or more chains. Each chain begins by stashing $c->model(
'whatever' ), followed by making one or more calls to
$c->stash->{whatever_ref}->some_method1, ...->some_method2 and so on

No calls to go, visit, or forward. This thin controller / fat model
approach results in controller actions that typically contain only one
line of code, a call to a model method. The model will probably require
an ACCEPT_CONTEXT method to stash a weaken'd reference to $c. The model
methods can then take input from $c->req and output to $c->stash

-- 

Regards



More information about the Catalyst-dev mailing list