[Catalyst] Access Catalyst context object from script

Anthony Gladdish anthony.gladdish at newcastle.ac.uk
Wed Oct 31 12:38:23 GMT 2012


>From: Dimitar Petrov [mailto:mitakaa at 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 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/module/Catalyst::View::TT), however I think "c" is shorter and >better default.
>
>Cheers 

That's not the issue here; I can use CATALYST_VAR to rename it to whatever I want, it still doesn't give me access to the Catalyst's context object outside of a catalyst app - which is what I'm after here.

I'm trying to get an external script run by a cronjob, to re-use an existing Catalyst template containing [% c.uri_for() %] statements that point to actions within the cat app itself, instead of having to hard code URIs.

Regards,
Anthony


More information about the Catalyst mailing list