[Catalyst] Configuring Catalyst::Model::DBIC::Schema from YAML

Jon Warbrick jw35 at cam.ac.uk
Mon Oct 2 19:13:48 CEST 2006


On Sun, 1 Oct 2006, Matthieu Codron wrote:

> Ash Berlin a écrit :
>
> > As to where it's documented, I cant seem to find it, but I'm sure it is 
> > somewhere, tho its clearly not obvious enough since I know its there and 
> > cant find it.
> 
> I found it here: 
> http://search.cpan.org/~mramberg/Catalyst-Runtime-5.7003/lib/Catalyst/Component.pm#COMPONENT(%24c%2C_%24arguments)
> 
> But it was not quite obvious ... 

Ah, now I know what this is about it makes some sense. If I'm right, 
Catalyst::Plugin::ConfigLoader simply populates the $c->config hash. For 
each component, Catalyst arranges to look for keys in $c->config that are 
named after the component's package (but with the application name 
removed, so FooBar::Model::FooBarDB becomes Model::FooBarDB) and if found 
the resulting values are merged into the component's own config before 
calling it's new(). Hence allowing components to be configured via 
ConfigLoader. Is that vaguely right?

If so it explains why the following YAML seems to correctly configure my 
Catalyst::Model::DBIC::Schema model, which is called 
lookup::Model::LookupDB. 

But for some reason my Catalyst::View::MicroMason 
view, called Lookup::View::MicroMason _isn't_ successfully configured - it 
behaves as if the extra mixins are not present. Anyone any idea why?

Jon.

---
name: Lookup

Model::LookupDB:
    schema_class: Ucam::LookupDB
    connect_info:
      - dbi:Pg:dbname=jw35

View::MicroMason:
    Mixins:
        - -Filters
        - -CompileCache

-- 
Jon Warbrick
Web/News Development, Computing Service, University of Cambridge


More information about the Catalyst mailing list