[Catalyst] modifying the template include_path from the application base

Jason Kohles email at jasonkohles.com
Tue Mar 14 21:45:37 CET 2006


On 3/14/06, Thomas Hartman <tphyahoo at gmail.com> wrote:
> In the first version of the code you are calling
>
> TToolkit->config
>
> In the second you are calling
>
> Commencement->config
>
> and then apparently hoping that setting the hash deeper in will have
> the same effect as the first bit of code.
>
> I'm not that versed in catalyst, but I wouldn't expect these to
> necessarily do the same things. If there is some reason that this *is*
> the expectation, I would welcome enlightenment...
>
Catalyst includes code to do exactly that, when creating an instance
of anything that inherits from Catalyst::Component, it will set the
default for that components configuration by looking in the main
configuration for a key with the class suffix of the component.  That
way you can easily put all your configuration into the same file,
without having to modify each component to read it's own section from
the configuration file.

You can find all this in Catalyst.pm in setup_components() if you want
to take a look at how it works...


        my $suffix = Catalyst::Utils::class2classsuffix($component);
        my $config = $class->config->{$suffix} || {};


--
Jason Kohles
email at jasonkohles.com - http://www.jasonkohles.com/
"A witty saying proves nothing."  -- Voltaire



More information about the Catalyst mailing list