The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Mojolicious::Plugin::YamlConfig - YAML Configuration Plugin

SYNOPSIS

# myapp.yaml
--
foo: "bar"
music_dir: "<%= app->home->rel_dir('music') %>"

# Mojolicious
$self->plugin('yaml_config');

# Mojolicious::Lite
plugin 'yaml_config';

# Reads myapp.yaml by default and puts the parsed version into the stash
my $config = $self->stash('config');

# Everything can be customized with options
my $config = plugin json_config => {
    file      => '/etc/myapp.conf',
    stash_key => 'conf'
};

DESCRIPTION

Look at Mojolicious::Plugin::JsonConfig and replace "json" with "yaml" and you should be fine. :)

AUTHOR

Danijel Tasov <data@cpan.org>

SEE ALSO

Mojolicious, Mojolicous::Plugin::JsonConfig, Mojolicious::Guides