[Catalyst] Anybody using Chained('.') ?
Robert 'phaylon' Sedlacek
rs at 474.at
Tue Mar 13 14:41:13 GMT 2007
Jason Kohles wrote:
> I'm trying to use Chained('.') to create a controller base class that
> binds to the namespace of whatever controller class inherits it, but
> despite the documentation specifically mentioning this use, I can't seem
> to get it to work.
Where does the documentation say that? In
Catalyst::DispatchType::Chained it says
Another interesting possibility gives :Chained('.'), which chains
itself to an action with the path of the current controller's
namespace.
and then shows two actions for two different controllers. You only have
one controller.
Try something like this:
package MyApp::Controller::Foo;
use strict;
use base 'Catalyst::Controller';
# is chained to
sub bar : Chained CaptureArgs(0) { }
1;
and
package MyApp::Controller::Foo::Bar;
use strict;
use base 'Catalyst::Controller';
# chains to /foo/bar, like this controllers namespace
sub baz : Chained('.') { }
1;
Although, this is untested, of course. But you can always take a look at
the Chained tests.
--
# Robert 'phaylon' Sedlacek
# Perl 5/Catalyst Developer in Hamburg, Germany
{ EMail => ' rs at 474.at ', Web => ' http://474.at ' }
More information about the Catalyst
mailing list