Mailing List Archive

Find Action via Public Path.
Hello,

Hope you're all well, =).

Do any of you know what the best way to find an action name, via a public path, may be?
I found $c->dispatcher->get_action_by_path($path) only works for private paths internal to our app.

So for example, if we have:
website.com/coolpage
...I've got the string "coolpage" and I want to call the associated action within my catalyst app.
I thought it would be more secure to use the string to look up a corresponding action name / subroutine, and then call that subroutine, rather than call a request for whatever happens to be in the string.

Any advice, appreciated.

Many thanks,

Yours,
Andrew M.
Re: Find Action via Public Path. [ In reply to ]
No one has replied yet, so I've taken to accomplishing the end result I was after using this:
http://wiki.catalystframework.org/wiki/wikicookbook/safedispatchusingpath

Basically...

my $string="coolpage";
$c->request->path($string);
$c->dispatcher->prepare_action($c);
$c->go($c->action, $c->request->args);


----- Original Message -----
From: Andrew
To: The elegant MVC web framework
Sent: Tuesday, December 05, 2017 5:00 AM
Subject: [Catalyst] Find Action via Public Path.


Hello,

Hope you're all well, =).

Do any of you know what the best way to find an action name, via a public path, may be?
I found $c->dispatcher->get_action_by_path($path) only works for private paths internal to our app.

So for example, if we have:
website.com/coolpage
...I've got the string "coolpage" and I want to call the associated action within my catalyst app.
I thought it would be more secure to use the string to look up a corresponding action name / subroutine, and then call that subroutine, rather than call a request for whatever happens to be in the string.

Any advice, appreciated.

Many thanks,

Yours,
Andrew M.



------------------------------------------------------------------------------


_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/