[Catalyst] How does config work?

Matt S Trout dbix-class at trout.me.uk
Fri Aug 12 22:32:10 CEST 2005


On Fri, Aug 12, 2005 at 04:06:54PM -0400, Christopher H. Laco wrote:
> So, if I have a model, say MyApp::Model::CDBI that calls 
> __PACKAGE__->config(dsn =>'foo'), that config is in:
> 
> 	$c->comp('MyApp::Model::CDBI')->{dsn)
> 
> Now, does that mean that most of these Model base modules are doing 
> something like:
> 
> 	$c->comp(caller[0])->{dsn}
> 
> to get the config set by the users models?
> 
> -=Chris

Nope. They get instantiated to a singleton-per-app object via the 'new' method
they inherit from Catalyst::Base. See ->setup_components in Catalyst::Setup
for more details.

-- 
     Matt S Trout           Website: http://www.shadowcatsystems.co.uk
  Technical Director        E-mail:  mst (at) shadowcatsystems.co.uk
Shadowcat Systems Ltd.

 + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +



More information about the Catalyst mailing list