[Catalyst] Forwarding to public URLs vs. private paths
    John Napiorkowski 
    jjn1056 at yahoo.com
       
    Tue Oct 17 16:16:14 CEST 2006
    
    
  
--- Matt S Trout <dbix-class at trout.me.uk> wrote:
> Bernhard Graf wrote:
> > Matt S Trout wrote:
> > 
> >> Public URLs are not private paths. This doesn't
> work, has never
> >> worked, and will never work, by design.
> >>
> >> Trying to forward to a MyApp::Controller::Foo sub
> bar :Path('/spoon')
> >> as /spoon won't work either, you'd need /foo/bar.
> >>
> >> This is consistent across all dispatch types and
> is neither anything
> >> to do with Chained for a bug :)
> > 
> > Ah, thank you for clearing this up.
> > Maybe this should be noted in the docs also to
> avoid confusion.
> 
> forward docs say "Forwards processing to another
> action, by its private name."
> 
> But yeah, it probably needs to be spelt out in Big
> Letters somewhere since the 
> most common case (:Local actions) actually *does*
> work as expected, but really 
> only by accident.
I think the original question about
forwarding/detaching to actions that are chain
endpoints isn't fully resolved.  I've been playing
with that and find that if I forward to a chain
endpoint the  root of the chain is activated but then
we don't walk up the chain to the endpoint specified. 
I've tried submitting args and preseting captures like
so:
$c->request->captures([qw/a b c/]);
$c->forward('edit',[qw/1 2 3/]); 
(assuming there is an action chain something like:
/images/images (0)
-> /images/image (1)
=> /images/edit
When I run the above forward I get:
/images/begin                                         
        
/images/index                                         
        
  -> /images/images                                   
         
/end
Probably not such a big deal but if this isn't going
to work we should probably add that as well to the
docs (I guess I'm volunteering :) )  Then again maybe
there is a way to make it work, but I didn't figure it
out.  If so I'd be interested in hearing about a
solution.
Oh, also we should mention there is a difference
between the private action name and the :Private
attribute.  I was tutoring someone starting Catalyst
last week and that was something he got confused
about, so I guessing others might as well.
--john
> 
> /me sacrifices fountain pen, casts spell of "summon
> documentation patches"
> 
> -- 
>       Matt S Trout       Offering custom
> development, consultancy and support
>    Technical Director    contracts for Catalyst,
> DBIx::Class and BAST. Contact
> Shadowcat Systems Ltd.  mst (at)
> shadowcatsystems.co.uk for more information
> 
> + Help us build a better perl ORM:
> http://dbix-class.shadowcatsystems.co.uk/ +
> 
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo:
> http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive:
>
http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/
> 
__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
    
    
More information about the Catalyst
mailing list