[dancer-users] Explicitly defining location of config.yml (current hitch on path to running Dancer as a service)

Stefan Hornburg (Racke) racke at linuxia.de
Fri Sep 16 11:47:00 BST 2016


On 09/16/2016 12:38 PM, Nik Mitev wrote:
> On 16/09/16 11:27, Stefan Hornburg (Racke) wrote:
>>> I was after the db_info key however, and was getting the plugin settings
>>> instead. This gets resolved if I ask for
>>> $dsl->app->config->{'db_info'}
>>> instead of
>>> $dsl->config->{'db_info'}
>>>
>>> Still not sure why $dsl->config->{'db_info'} returns the data for
>>> $dsl->config->{'plugins'}->{'ESS2::Auth'}
>> Because the first parameter is the $plugin object and not a DSL object :-).
> I am not sure I understand, sorry :)
> So effectively $dsl->config when used within a plugin has the same
> effect as $dsl->plugin_setting?
> 

register foobar => sub {
   my ($plugin, ...) = @_;

   ...
}

The first parameter here is the Dancer2::Plugin object which has a
config method, and logically provides the plugin configuration.

So if you are using $dsl variable name, that is confusing and
not accurate.

$plugin->app gives you App object, which also has a config method.
This logically provides the app configuration.

Regards
	Racke


-- 
Ecommerce and Linux consulting + Perl and web application programming.
Debian and Sympa administration.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20160916/1e725389/attachment.sig>


More information about the dancer-users mailing list