RE: [Catalyst] Access Catalyst context object from script

2012-11-01 Thread Anthony Gladdish
>From: Bill Moseley [mailto:mose...@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 > wrote: > >Great

Re: [Catalyst] Access Catalyst context object from script

2012-11-01 Thread Bill Moseley
On Wed, Oct 31, 2012 at 6:10 AM, Anthony Gladdish < anthony.gladd...@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

RE: [Catalyst] Access Catalyst context object from script

2012-10-31 Thread Anthony Gladdish
>-Original Message- >From: Alexander Hartmaier [mailto:alexander.hartmaier@t- >systems.at] >Sent: 31 October 2012 12:46 >To: catalyst@lists.scsys.co.uk >Subject: Re: [Catalyst] Access Catalyst context object from script >I suggest to load your Catalyst app with a conf

Re: [Catalyst] Access Catalyst context object from script

2012-10-31 Thread Alexander Hartmaier
On 2012-10-31 13:30, Anthony Gladdish wrote: >> -Original Message- >> From: Ian Docherty [mailto:catal...@iandocherty.com] >> Sent: 31 October 2012 11:29 >> To: The elegant MVC web framework >> Subject: Re: [Catalyst] Access Catalyst context object from scri

RE: [Catalyst] Access Catalyst context object from script

2012-10-31 Thread Anthony Gladdish
>From: Dimitar Petrov [mailto:mita...@gmail.com] >Sent: 31 October 2012 11:18 >To: The elegant MVC web framework >Subject: Re: [Catalyst] Access Catalyst context object from script > >Hello Anthony, > >I think the catalyst object is not called Catalyst but c, this

RE: [Catalyst] Access Catalyst context object from script

2012-10-31 Thread Anthony Gladdish
>-Original Message- >From: Ian Docherty [mailto:catal...@iandocherty.com] >Sent: 31 October 2012 11:29 >To: The elegant MVC web framework >Subject: Re: [Catalyst] Access Catalyst context object from script > >On 31 October 2012 10:41, Anthony Gladdish > wrote: &

Re: [Catalyst] Access Catalyst context object from script

2012-10-31 Thread Ian Docherty
On 31 October 2012 10:41, Anthony Gladdish wrote: > Hi, > > Got a lot of code in a controller that should be moved out and into an > external script (that's called by a cronjob) which calls stuff from the Model > and then emails it. > > The script can access the model fine and re-use a Template:

Re: [Catalyst] Access Catalyst context object from script

2012-10-31 Thread Rob Brown
Your script is not running under Catalyst, so $c, or the Catalyst context, is not available. $c manages HTTP requests and responses. It sounds like your approach/design may be slightly flawed. Perhaps explain what you're trying to achieve - what are you doing with these templates? where are

Re: [Catalyst] Access Catalyst context object from script

2012-10-31 Thread Dimitar Petrov
Hello Anthony, I think the catalyst object is not called Catalyst but c, this you need [% c.uri_for(...) %] or you can use [% c.uri_for_action(...) %] to point to particular action. You could change that setting the CATALYST_VAR into your view configuration (as shown here https://metacpan.org/modu