[Catalyst] Access Catalyst context object from script

Anthony Gladdish anthony.gladdish at newcastle.ac.uk
Thu Nov 1 15:34:41 GMT 2012

>From: Bill Moseley [mailto:moseley at hank.org] 
>Sent: 01 November 2012 14:14
>To: The elegant MVC web framework
>Subject: Re: [Catalyst] Access Catalyst context object from script
>On Wed, Oct 31, 2012 at 6:10 AM, Anthony Gladdish <anthony.gladdish at newcastle.ac.uk> wrote:
>Great - this worked, thanks. I used:
>        use Catalyst::Test 'MyApp';
>        my($res, $c) = ctx_request('/');
>How does uri_for() know what host:port and script path to use to build correct URLs to your site?

Got a front-end proxy setup, so not worried about host:port as I can just replace "localhost" with whatever my web server is using at the time, in the template. A bit hacky I know, but at least I've got the correctly generated path without hard coding it in.

Unless, you know of an alternate way/better way of tricking context object or Catalyst::Test in using a specific host:port?


More information about the Catalyst mailing list