[Catalyst] Another RFC. $c->call()

Nilson Santos Figueiredo Junior acid06 at gmail.com
Fri Apr 14 04:56:33 CEST 2006


On 4/13/06, Sebastian Riedel <sri at oook.de> wrote:
>      $c->action('/foo/bar')->forward;
>      $c->action('/foo/bar')->detach;
>
> or (suggested by mst):
>
>      $c->forward( $c->action('/foo/bar') );
>      $c->detach( $c->action('/foo/bar') );

I really think that the best solution would be something not backwards
compatible if that's something reasonable (maybe provide
backwards-compatibility through a plugin).

$c->call('foo'): would do what $c->forward('foo') does today
$c->forward('foo'): would be just like $c->call('foo') but would also
change the action

$c->dispatch('foo'): would do what $c->detach('foo') does today
$c->detach('foo'): would do just like $c->dispatch('foo') but would
also change the action

I think this way the verbs would be best representing what they actually do.

Of course, this might break stuff and make all hell break loose and is
very similar to a previously mentioned alternative which people didn't
seem to like that much. But I, at least, think this would be the best
way to go if we don't want to end up being excessively verbose for
doing something that should be a simple task.

-Nilson Santos F. Jr.



More information about the Catalyst mailing list