[dancer-users] Calling plugin_setting from a plugedin keyword
Henk van Oers
henk at signature.nl
Sun Mar 8 10:02:39 GMT 2015
In Dancer2::Plugin::Passphrase on line 75 I have:
my $settings = plugin_setting();
Keyword 'plugin_setting' is exported by Dancer2::Plugin.
In an app I can use the keyword 'passphrase' and it's in the dsl.
In an other plugin I want to use the 'passphrase' keyword.
package Dancer2::Plugin::Peek;
# ABSTRACT: Peek around
use Dancer2::Plugin;
use Data::Peek;
sub peekplugin {
my ($dsl, @args) = plugin_args(@_);
my $phrase = $dsl->passphrase( 'my password' )->generate->rfc2307;
$dsl->var(peekphrase => DDumper \$phrase);
}
register peekplugin => \&peekplugin;
register_plugin;
1;
__END__
Yes. I can see the generated phrase in a template.
But I also get:
DEPRECATED: Dancer2::Plugin::Peek calls 'dsl' instead of '$dsl->dsl'. at
/usr/local/lib/perl5/site_perl/Dancer2/Plugin/Passphrase.pm line 75.
So, the question is:
How do I call 'plugin_setting' in a D2 plugin?
--
Henk van Oers
More information about the dancer-users
mailing list