Mailing List Archive

bug: visit() calling end()
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()?


According to the documentation visit() should not call end() (POD &&
http://ion0.com/hx/redispatch.png)

t/aggregate/live_component_controller_action_visit.t explicitely tests
for more then one end() though.


cheers
david

_______________________________________________
Catalyst-dev mailing list
Catalyst-dev@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev
Re: bug: visit() calling end() [ In reply to ]
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

_______________________________________________
Catalyst-dev mailing list
Catalyst-dev@lists.scsys.co.uk
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst-dev