[Catalyst] Mason configuration in YAML

Kevin Old kevinold at gmail.com
Thu Dec 7 19:37:17 GMT 2006


Hi Mark,

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.

HTH,
Kevin

On 12/7/06, Marc Logghe <Marc.Logghe at devgen.com> wrote:
>
>
> Hi there,
> I am struggling with the configuration of the Mason view in YAML.
> I have this:
> View::Mason:
>   comp_root: __path_to(mason/root)__
>   data_dir: __path_to(mason/data)__
>
> But as it seems, it is never taken into account. I have also tried forcing
> an array ref, whithout any succes:
> View::Mason:
>   -
>     comp_root: __path_to(mason/root)__
>     data_dir: __path_to(mason/data)__
>
> What am I doing wrong ?
> Regards,
> Marc
> _______________________________________________
> List: Catalyst at lists.rawmode.org
> Listinfo:
> http://lists.rawmode.org/mailman/listinfo/catalyst
> Searchable archive:
> http://www.mail-archive.com/catalyst@lists.rawmode.org/
> Dev site: http://dev.catalyst.perl.org/
>
>
>


-- 
Kevin Old
kevinold at gmail.com



More information about the Catalyst mailing list