SweetPea::Application::Config - Configuration handling for SweetPea-Application.


SweetPea-Application documentation  | view source Contained in the SweetPea-Application distribution.

Index


NAME

Top

SweetPea::Application::Config - Configuration handling for SweetPea-Application.

SYNOPSIS ... from inside SweetPea::Application or a Controller; my $configuration = $s->config->get('/application'); my $datasources = $s->config->get('/datasourses');

Top

METHODS

Top

new

    The new method instantiates a new SweetPea::Application::Config object
    which use Config::Any as a base class to provide access to the yml documents.

    $s->plug( 'config', sub { return SweetPea::Application::Config->new($s); });

get

    The get method returns a reference to the specific configuration data of
    the key passed to it or returns undefined.

    my $foo = $s->config->get('/application');
    if (defined $foo) {
        $foo->{datasource} = 'production';
    }
    else {
        die '/application config file is undefined';
    }

set

    The set method saves any changes to the configuration data of the file
    identified by the key passed to it or returns undefined.

AUTHOR

Top

Al Newkirk, <al.newkirk at awnstudio.com>


SweetPea-Application documentation  | view source Contained in the SweetPea-Application distribution.