I'm unable to get my scripts to read config/foo.yaml.
If I manually add the variables to config.yaml I can read them.
This is perl, v5.8.4 built for i386-linux-thread-multi (Debian), Kwiki::0.38
The test script below produces this error when I install Kwiki::Foo and click
TestFoo:
Can't locate object method "foo_var" via package "Kwiki::Config" at
lib/Kwiki/Foo.pm line 24.
The file config/foo.yaml is created, but the variable can't be read.
--
Jeff
###################
package Kwiki::Foo;
###################
use strict;
use warnings;
use Kwiki::Plugin '-Base';
use Kwiki::Installer '-base';
const class_id => 'foo';
const config_file => 'foo.yaml';
sub init {
$self->hub->config->add_file('config/foo.yaml');
}
sub register {
my $registry = shift;
$registry->add( preload => 'foo');
$registry->add( action => 'foo_test');
$registry->add( toolbar => 'foo_button',
template => 'foo_button.html',
);
}
sub foo_test {
my $var = $self->hub->config->foo_var;
}
1;
__DATA__
__config/foo.yaml__
foo_var: 9
__template/tt2/foo_button.html__
<a href="?action=foo_test">TestFoo</a>