On Mon, Mar 28, 2011 at 6:49 PM, Derek Wueppelmann <[email protected]> wrote:
> I want to be able to setup a configuration variable in my Catalyst config
> that will then be set as the value for one of my model's class variables.
> I have a model that will want to use a base path to store some files, However
> the Model doesn't know how to access Catalyst and so it can't get the data it
> needs. The other issue is that I need it as a class variable so that all of
> the instances of a particular class can access the same value once set. I'm
> thinking about calling an after method in the root Catalyst app module to set
> the variable, but I'm not sure which one I should modify.
>
> Anybody with some suggestions?
>
> --
>  o)   Derek Wueppelmann           (o
> (D .   [email protected]          D).
> ((`     http://www.monkeynet.ca   ( ) `
>
>
> _______________________________________________
> List: [email protected]
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/[email protected]/
> Dev site: http://dev.catalyst.perl.org/
>

Usually that's achieved by adding an attribute to your model and then
providing the value at model instantiation time

Example:
http://wiki.catalystframework.org/wiki/wikicookbook/configpass2schema

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

Reply via email to