Hideo Kimura wrote:
Hi,
Does anybody knows how to set config of each Controllers in YAML file?
Before I can do it following way with ConfigLoader, but it doesn't work now.
in yml file
Controller::Foo:
foo: bar
in controller
sub default : Private {
my ($self, $c) = @_;
my $config = $self->config;
...
}
That's wrong, the class config is the prototype.
__PACKAGE__->mk_accessors(qw/foo/);
sub default : Private {
my ($self, $c) = @_;
warn $self->foo; # bar
}
_______________________________________________
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/