[Catalyst] C::C::FormBuilder question

Carl Franks fireartist at gmail.com
Wed Jan 31 08:45:26 GMT 2007


On 30/01/07, Matt S Trout <dbix-class at trout.me.uk> 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



More information about the Catalyst mailing list