On 30/01/07, Matt S Trout <[EMAIL PROTECTED]> wrote:

On 30 Jan 2007, at 08:48, Carl Franks wrote:
> I was just looking at this last week, as I was using the code as a
> basis for a new controller. I suspect that it's never been tested,
> because as far as I can tell, it incorrectly reads the config from the
> controller object, rather than the application object.

That's what it's supposed to do! This is a feature, not a bug - and
the fact that all the plugin-style ones (HW, DFV etc.) use global
config if frankly a bug in *them* since it makes code re-use much
harder.

If you need common defaults, use a controller base class. Works
beautifully.

ok, that's cool.
I still tend to keep all config in a single external config file, so I
hadn't come across that.

Would best practise then be something like this?...

   my $config = $self->config->{'Controller::MyApp'}
       || $c->config->{'Controller::MyApp'}
       || {};


Cheers,
Carl

_______________________________________________
List: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to