[Catalyst] stripping path parts and then redispatch?
Larry Leszczynski
larryl at emailplus.org
Sun Feb 22 22:28:48 GMT 2009
Hi all -
I have an existing site, and want to add the page language to the URLs
so that caching will work correctly, e.g. "/foo/bar" would now look like
"/en/foo/bar" or "/fr/foo/bar". (The language is user-selected, not
from browser prefs, so setting the "Vary: Accept-Language" response
header won't help.)
I'd like to be able to capture and strip off the language, in e.g.
MyApp::Controller::Root::auto(), and then either forward or redispatch
to the existing controllers, but haven't been able to come up with a way
of generating the forwarding path/args that consistently works for all
action types. E.g., how do I know if I should dispatch to action
"/foo/bar", or action "/foo" with argument "bar"?
I'm trying to avoid using chained actions, because as best as I can
figure out that would require all existing controllers to be rewritten
to be aware of the chaining.
Any ideas about how to do this, or of a different way to accomplish the
same thing?
I'm using Catalyst 5.8.5 so I can make use of any of forward, detach,
visit, go, etc.
Thanks!
Larry
More information about the Catalyst
mailing list