[Catalyst] Configuring a Controller from the config file

Moritz Onken onken at houseofdesign.de
Fri Aug 1 10:22:24 BST 2008


>
> Which contains the class-level defaults.
>
> Not application defaults.
>
> You should never, ever EVER access $self->config in a model, view or
> controller object.
>
> Your config value will be in $self->{key}.
>
> It's considered normal to do
>
> package My::Controller::Foo;
>
> use strict;
> use warnings;
> use parent qw(Catalyst::Controller);
>
> __PACKAGE__->mk_accessors(qw(foo bar));
>
> __PACKAGE__->config(
>  foo => 'default_for_foo',
>  bae => { default => 'for_bar' },
> );

Thanks a lot!
works great :-)



More information about the Catalyst mailing list