[Catalyst] Configuration Approach

Bernard FRIT bernard.frit at gmail.com
Tue Oct 25 14:24:38 CEST 2005

2005/10/25, Cédric Bouvier <cbouvi at free.fr>:
> This data format looks very nice, but I cannot find the way to perform
> any kind of interpolation within the YAML file.
> I'd love to have something like this:
>     home: /home/cbouvi/dev/MyApp
>     include_templates: $home/templates/lib

So far it seems that YAML will not allow this.

> Unfortunately, it seems that I must expand $home myself, i.e.:
>     home: /home/cbouvi/dev/MyApp
>     include_templates: /home/cbouvi/dev/MyApp/templates/lib
> Is there a way to avoid copy'n'pasting throughout the whole config file?
> Or is it not an issue because of something that I might have overlooked
> and that makes my concerns completely irrelevant...

Just expand within your code concatenating
__PACKAGE__->config->{home} and __PACKAGE__->config->{include_templates}

home: /home/cbouvi/dev/MyApp
include_templates: /templates/lib
in your config.yml file.

Bernard FRIT

More information about the Catalyst mailing list