[Catalyst] How does config work?

Sebastian Riedel sri at oook.de
Fri Aug 12 21:41:25 CEST 2005


Am 12.08.2005 um 21:09 schrieb Christopher H. Laco:
> I see WritingPlugins mentions that it's good practice to save  
> module specific config in a seperate module-named hash under  
> config... where does config information go when I do this in a an  
> M, V, C that's not the root...

It goes into the instances.

     $c->comp('MyApp::C::Email')->{foo};


     package MyApp::C::Email;
     sub do_stuff {
         my ( $self, $c ) = @_;
         $self->{foo};
     }

Note that its also possible to configure components in the app class.

     MyApp->config->{'MyApp::C::Email'} = { foo => 'bar' };

--
sebastian




More information about the Catalyst mailing list