Yes, sorry, I haven't explained very well, and I think I have found a
I have a few databases which are similar. Most of the tables are the same,
and in some of them I have more other tables or some tables redefined.
I want to test the application using a certain database, and if all works
right, I want to use it with another one, and I don't want to need creating
another Catalyst application just because I have changed the database.
If I write the name of the database in more modules it will be harder to
change its name, but now I I think that I could use something like:
and just change the name of the db in the application config.
----- Original Message -----
From: "Robert 'phaylon' Sedlacek" <firstname.lastname@example.org>
To: "The elegant MVC web framework" <email@example.com>
Sent: Sunday, December 24, 2006 8:14 AM
Subject: Re: [Catalyst] schema
Octavian Rasnita said:
I need to access the same database in more controller modules, using the
following line in every subroutine and every module:
my $schema = $c->model('DB');
Is it possible to define it only in one place and make it available in the
Sorry, I don't get it. $c->model() *is* available in the entire application.