[Catalyst] auto-loading config for classes
Alan Tam
Tam at SiuLung.com
Sat Sep 24 18:24:57 CEST 2005
Matt S Trout wrote:
>>But if it is my own code, why not just use a string to represent the class.
>>
>>
>Re-usability, as I already mentioned. Plus the fact that $c->comp will return an instantiated object with the appropriate config if the class inherits from Catalyst::Base - and the fact that having one standard convention throughout my code makes life easier.
>
>
I heard about the config feature, which allow me to initialize config
for a class w/o specifying any code in that class. But I never get it
working. Currently I need to file
__PACKAGE__->config(YAML::LoadFile(...)); for each class, which I think
is suboptimal.
I also noticed Catalyst::Plugin::Config::YAML whose documentation seems
to imply that I can put all config into one YAML file and use the
section of the file to indicate which class the keys are for.
Is there any pointer to working code?
--
Regards,
Alan
More information about the Catalyst
mailing list