X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FManual%2FIntro.pod;h=21a701d22b509352faa6b6a0b1986cab53cb43d5;hp=5bdac66b35c17fa897f4c383c7ae71d014a9da58;hb=5882c86e1f256e122583dcc311b17bdbf9a4d766;hpb=2c23b46d57d31a415a6676656ea86d26599af52a diff --git a/lib/Catalyst/Manual/Intro.pod b/lib/Catalyst/Manual/Intro.pod index 5bdac66..21a701d 100644 --- a/lib/Catalyst/Manual/Intro.pod +++ b/lib/Catalyst/Manual/Intro.pod @@ -417,21 +417,21 @@ C<$c-Ereq-Ecaptures-E[0]> would be "23". If you want to pass arguments at the end of your URL, you must use regex action keys. See L below. -=item * B +=item * B - sub section :PathPart('section') :ChildOf('/') :Captures(1) { } + sub section :PathPart('section') :Chained('/') :Captures(1) { } -ChildOf is a powerful way to handle canonical URIs of the form +Chained is a powerful way to handle canonical URIs of the form C. Using this URI as an example, in Controller::Root you can do the following: - sub section_handler :PathPart('section') :ChildOf('/') :Captures(1) { + sub section_handler :PathPart('section') :Chained('/') :Captures(1) { my ( $self, $c ) = @_; $c->stash->{'section'} = $c->Model('Sections')->find($c->req->captures->[0]); } - sub item_handler :PathPart('item') :ChildOf('/section') :Args(1) { + sub item_handler :PathPart('item') :Chained('/section_handler') :Args(1) { my ( $self, $c ) = @_; $c->stash->{'item'} = $c->stash->{'section'}->find_related('item',$c->args->[0]); @@ -448,37 +448,37 @@ L below for more options. A parent action can be in any controller or namespace. -Multiple actions can specify the same parent action in their C; +Multiple actions can specify the same parent action in their C; that is, one action can have multiple children. -=item ChildOf('xyz') +=item Chained('xyz') The action of the parent. For instance, if you have a method C in the controller C, the action would be C. For a Root handler this would be '/'. For an action in the same controller namespace you can use -a relative name like C<:ChildOf('foo')>. +a relative name like C<:Chained('foo')>. =item PathPart('xyz') -The name of this path section in the ChildOf tree mapping to the URI. If +The name of this path section in the Chained tree mapping to the URI. If you specify C<:PathPart> without arguments, it takes the name of the action specifying the argument. For example, these two declarations have the same effect: - sub foo :PathPart('foo') :ChildOf('bar') :Args(1) { + sub foo :PathPart('foo') :Chained('bar') :Args(1) { ... } and - sub foo :PathPart :ChildOf('bar') :Args(1) { + sub foo :PathPart :Chained('bar') :Args(1) { ... } The value can also contain a slash, for example: - sub baz :PathPart('bar/baz') :ChildOf('/') :Captures(1) { + sub baz :PathPart('bar/baz') :Chained('/') :Captures(1) { ... } @@ -488,7 +488,7 @@ would be involved in matches on C paths. Will 'collapse' the next C path segments in the request URI and push them into the arrayref C<$c-Ereq-Ecaptures>. An action -specifying C is thought to be used as target for C +specifying C is thought to be used as target for C specifications. Also see the C attribute below, which is used for endpoints. @@ -500,7 +500,7 @@ equivalent of the index action. Args with no parameters will capture every postfixed segment into C<$c-Ereq-Eargs>. A specification of C is seen as endpoint in regard to an additional -C specification. +C specification. =item * B (B)