[Catalyst] Getting relative path to methods

Derek Wueppelmann dwueppel at gmail.com
Tue Dec 15 18:51:39 GMT 2009


Hello all, 

I'm currently using FormBuilder to generate some forms to be used in my
Catalyst Application. However FormBuilder wants to have the same method
handle the submit as well as the display. For certain reasons this isn't
what I want. So I'm trying to set the action of the form to the correct
path. However FormBuilder only wants to take a path that is rooted for
it's action argument, for example:

$form = $self->formbuilder();
# Works:
$form->action('/path/to/method');

# Doesn't work:
$form->action('path/to/method');
# Still doesn't work:
$form->action("http://example.com/path/to/method");

What I really want to be able to use is something like:

$c->uri_for($self->action_for('method_name'), ...);

However this returns a url complete with the HTTP. Is it possible to get
something similar that provides just the path (/path/to/method)? The
reason I want to do it this way is that I have some methods that are
submitting to URLS that contain captures.

-- 
 o)   Derek Wueppelmann           (o
(D .   dwueppel at gmail.com          D).
((`     http://www.monkeynet.ca   ( ) `





More information about the Catalyst mailing list