From: Peter Edwards 
  On 12 April 2011 00:50, Charlie Garrison <garri...@zeta.org.au> wrote:

    Good morning,

    On 11/04/11 at 6:58 PM +0300, Octavian Rasnita <orasn...@gmail.com> wrote:


      The TT templates used by the Catalyst app might contain many things
      like c.user, c.uri_for_action, may display images, may depend on other
      templates which are loaded automaticly when those templates are
      specified in the app config file. So there is no sane way of using
      those wrapper templates for sending email from a cron job.


    That was the conclusion I was reaching; I wanted feedback from others 
before I tried to make my own garden path.


  Put the logic in a model class that reads a config shared with but 
independent from your controller so you can run it outside of Catalyst.
  This article outlines how to do this 
http://www.catalystframework.org/calendar/2007/14

  At the top of that article appears:

  "UPDATE: As of 2008, there is a new module which avoids the "kludgy" solution 
mentioned below: Config::JFDI."

  At a certain moment, Config::JFDI started to support "__path_to()".

  The problem is not the model only, but the templates that use the Catalyst 
context in them.

  As it is not very recommended to access the entire Catalyst context in a 
model, it should be not recommended to use the context in the templates, 
because those templates won't be usable in external applications without 
loading the entire Cat app, but because using the Catalyst context in the 
templates is very handy, most of us probably prefer to create separate 
templates for using them in external apps than to provide only sane variables 
to all the templates.

  Octavian
_______________________________________________
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/

Reply via email to