<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV><DIV>On Mar 13, 2007, at 10:41 AM, Robert 'phaylon' Sedlacek wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Jason Kohles wrote:</DIV> <BLOCKQUOTE type="cite"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">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.</DIV> </BLOCKQUOTE><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">Where does the documentation say that? In Catalyst::DispatchType::Chained it says</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space">  </SPAN>Another interesting possibility gives :Chained('.'), which chains</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space">  </SPAN>itself to an action with the path of the current controller's</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><SPAN class="Apple-converted-space">  </SPAN>namespace.</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; "><BR></DIV></BLOCKQUOTE><DIV>Apparently I misunderstood the relationship between Chained and PathPart, and therefore misunderstood what the documentation was saying here.  So now the way I understand it is that Chained('.') means to setup a chain segment that has as it's parent the chain segment that matches the current controller's namespace.  Apparently what I'm actually looking for is the equivalent of Chained('/') PathPart('.'), meaning I want to build chains that originate in the current namespace.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>What I'm actually trying to accomplish is something like this:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>package MyApp::CRUDController;</DIV><DIV>use strict;</DIV><DIV>use warnings;</DIV><DIV>use base 'Catalyst::Controller';</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV># sub base : Chained(???) PathPart(???) CaptureArgs(0) { }</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>sub id : Chained('base') PathPart('id') CaptureArgs(0) { }</DIV><DIV>sub list : Chained('base') PathPart('') Args(0) { }</DIV><DIV>sub view : Chained('id') PathPart('view') Args(0) { }</DIV><DIV>sub edit : Chained('id') PathPart('edit') Args(0) { }</DIV><DIV>sub delete : Chained('id') PathPart('delete') Args(0) { }</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>1;</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>package MyApp::Controller::Foo;</DIV><DIV>use strict;</DIV><DIV>use warnings;</DIV><DIV>use base 'MyApp::CRUDController';</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV># So here I would like to get these chained actions:</DIV><DIV># /foo/list</DIV><DIV># /foo/id/*/view</DIV><DIV># /foo/id/*/edit</DIV><DIV># /foo/id/*/delete</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>1;</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>But the only way I can find to do this with Chained is by putting something like this in each controller subclass:</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>sub base : Chained('/') PathPart('foo') CaptureArgs(0) { }</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>And I would rather not do that if I can avoid it, I'd rather have it automatic, based on the namespace of the class that is inheriting the superclass.</DIV></DIV><BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>-- </DIV><DIV>Jason Kohles</DIV><DIV><A href="mailto:email@jasonkohles.com">email@jasonkohles.com</A></DIV><DIV><A href="http://www.jasonkohles.com">http://www.jasonkohles.com</A>/</DIV><DIV>"A witty saying proves nothing."  -- Voltaire</DIV><BR class="Apple-interchange-newline"></SPAN></SPAN> </DIV><BR></BODY></HTML>