Catalyst configuration (class)
- Classes can declare default configuration values
- Example:
package MyApp::Model::Foo; # Controller/Component/View also Ok
use base 'Catalyst::Model';
__PACKAGE__->config( foo => 'bar' );
sub read_foo_config {
my $self = shift;
return $self->{foo};
}
- set default with __PACKAGE__->config
- read with $self->{key}
- DO NOT READ __PACKAGE__->config
- DO NOT READ __PACKAGE__->config!
- really, it's write-only