[Catalyst] Mason configuration in YAML

Carl Vincent c.a.vincent at newcastle.ac.uk
Tue Mar 13 16:51:44 GMT 2007


Following up from a mail way-back-when:

>> -----Original Message-----
>> From: Kevin Old [mailto:kevinold at gmail.com] 
>> Sent: Thursday, December 07, 2006 8:37 PM
>> To: The elegant MVC web framework
>> Subject: Re: [Catalyst] Mason configuration in YAML
>> 
>> I'm pretty sure you need to do it like this:
>> 
>> In your YAML file specify comp_root and data_dir:
>> 
>> comp_root: __path_to(mason/root)__
>> data_dir: __path_to(mason/data)__
>> 
>> then in Mason.pm you can use it like this:
>> package MyApp::View::Mason;
>> 
>> use base 'Catalyst::View::Mason';
>> 
>> __PACKAGE__->config->{DEBUG} = 'all';
>> __PACKAGE__->config->{comp_root} = $c->config->{comp_root}; 
>> __PACKAGE__->config->{data_dir} = $c->config->{data_dir};
>> 
>> 1;
>> 
>> Catalyst::View::Mason doesn't look for these by default (like 
>> Catalyst::Plugin::Session, for instance) which is why you 
>> have to specify them in the Mason.pm.

> Ahh, OK, thanks. So it seems that not all C::V::* or C::M::* follow
the
> same 'rules'.
> The ones I used up to now (View::TTSite, Model::DBIC, and
C::P::Session
> you mentioned) can be configured in yml that way.
> For that reason I (wrongly) assumed that all modules behaved like
this.
> On the other hand, I think it would be a Good Thing(tm) if they would
> all follow the same way of configuration. 

I'm not sure thet Catalyst::View::Mason is under "active maintenance"
but I've sent a patch to rt.cpan.org #25413 which proposes a fix to make
C::V::M pick up config from the normal config files.

Cheers
Carl
(IRC: CaptainCarlos)

-- 
     -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
     Carl Vincent             http://www.netskills.ac.uk/ (URL)
     Systems Manager                       0191 222 5003 (voice)
     Netskills, Newcastle University       0191 222 5001  (fax)
     Training  -  Accreditation  -  Consultancy  -  Development



More information about the Catalyst mailing list