List Info

Thread: How to set config of Controller in YAML file?




How to set config of Controller in YAML file?
user name
2006-11-30 20:18:17
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;
    ...
}

Thanks

--
hide



_______________________________________________
List: Catalystlists.rawmode.org
Listinfo: ht
tp://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-
archive.com/catalystlists.rawmode.org/
Dev site: http://dev.catalyst.per
l.org/
How to set config of Controller in YAML file?
user name
2006-11-30 21:35:41
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: Catalystlists.rawmode.org
Listinfo: ht
tp://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-
archive.com/catalystlists.rawmode.org/
Dev site: http://dev.catalyst.per
l.org/
How to set config of Controller in YAML file?
user name
2006-11-30 23:06:48
On Thu, 30 Nov 2006 21:35:41 +0000
Matt S Trout <dbix-classtrout.me.uk> wrote:

> 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
> }

It works fine.
Thanks for your reply.

--
hide



_______________________________________________
List: Catalystlists.rawmode.org
Listinfo: ht
tp://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-
archive.com/catalystlists.rawmode.org/
Dev site: http://dev.catalyst.per
l.org/
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )