[Catalyst] Accessing YAML details from within the Model libraries

Anthony Gladdish A.J.Gladdish at newcastle.ac.uk
Thu Jan 18 12:15:27 GMT 2007


Hi,

I'm trying to pull out all my DBIx::Class connection details for my
Catalyst application, from a .yml config file, something like:

---
model: MyCatPackage::Cat::Model::MyPackageDB
schema_class: MyPackage::Schema
connect_info:
    dsn: DBI:mysql:database=somedb;host=somehost
    username: user1
    password: password1

Is it possible to access these details from the application's Model
libraries? If so, what is the recommended way?

I only seem to be able to access '__PACKAGE__->config->{schema_class}'
(for example), via the catalyst application's main library, and NOT from
within any of the Model libraries.

Thanks,

Anthony



More information about the Catalyst mailing list