[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:27:45 BST 2016


On 09/16/2016 12:21 PM, Nik Mitev wrote:
> On 16/09/16 11:04, Stefan Hornburg (Racke) wrote:
>> You need to ask for the plugin config, e.g. with plugin_setting keyword.
> That is indeed a shorter way of getting the settings for the plugin,
> which I will use.
> 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 :-).

>> A nicer way is to use an accessor in your plugin:
>>
>> https://metacpan.org/pod/Dancer2::Plugin#Getting-default-values-from-config-file
> I don't consider myself a perl pro and frankly don't quite understand
> the object-oriented side of it... still hoping I will not need to dig
> into it :) Is it unreasonable to think I can maintain a Dancer2 app well
> without learning object oriented perl?
> 

Yes, you can up to a point but it isn't as beautiful.

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/9367379a/attachment.sig>


More information about the dancer-users mailing list