[Catalyst] ConfigLoader manpage patch

greg at momotaro.chinmin.edu.tw greg at momotaro.chinmin.edu.tw
Sun Mar 9 14:32:56 GMT 2008


I was having trouble finding info on how to retrieve config file 
data in my modules. And castaway suggested I send in a patch.

So here is a patch against version 0.19 of ConfigLoader.pm, saying 
it's in a hash returned by the config method.

greg at healthy:~/dic$ diff -u ConfigLoader.pm.orig ConfigLoader.pm 
--- ConfigLoader.pm.orig        2008-03-08 12:58:06.000000000 +0800
+++ ConfigLoader.pm     2008-03-08 13:42:03.000000000 +0800
@@ -26,6 +26,15 @@
     # you can specify a file if you'd like
     __PACKAGE__->config( 'Plugin::ConfigLoader' => { file => 'config.yaml' } );

+  In the file, assuming it's in YAML format:
+
+    foo: bar
+
+  Accessible through the context object, or the class itself
+
+   $c->config->{foo}    # bar
+   MyApp->config->{foo} # bar
+
 =head1 DESCRIPTION

 This module will attempt to load find and load a configuration

--



More information about the Catalyst mailing list