Hi everyone

I'm writing a Catalyst app and currently trying to generate a breadcrumbs script (Catalyst::Plugin::Breadcrumbs has been helpful in pointing me in the right direction, but doesn't quite do what I want and in any case doesn't seem to have been touched since 2006).

I'm using chained actions and one or two of my controllers have multiple links in the chain; therefore I think I need to expand these actions from $c->request->action in order to get proper breadcrumbs - however I don't seem to be doing this correctly; as far as I can tell, I should be able to call $c->dispatcher->expand_action, but putting the result of this into a debug statement to see the result yielded an error:

The code: $c->log->debug( $c->dispatcher->expand_action( $c->request->action ) );

Errors with:
'Can't call method "attributes" without a package or object reference at D:/WAMP/Perl/site/lib/Catalyst/DispatchType/Chained.pm line 458' (yeah, Windows, don't hate me - developing on my work laptop, it'll be on CentOS eventually! :-) )

I am sure I'm probably doing something really stupid like passing the wrong value into the expand_action sub, but I can't think what else may actually need to go in there, as far as I can tell it takes a Catalyst action.

Many thanks in advance for any assistance you may be able to give.

Chris


In reply to Catalyst::Dispatcher - usage of expand_actions by mkchris

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.