GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Mojolicious::Plugin::YamlConfig(3) User Contributed Perl Documentation Mojolicious::Plugin::YamlConfig(3)

Mojolicious::Plugin::YamlConfig - YAML Configuration Plugin

    # 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
    plugin yaml_config => {
        file      => '/etc/myapp.conf',
        stash_key => 'conf',
        class     => 'YAML::XS'
    };

Look at Mojolicious::Plugin::JSONConfig and replace "JSONConfig" with "yaml_config" and you should be fine. :)

YAML::Tiny is the default parser. It doesn't even try to implement the full YAML spec. Currently you can use YAML::XS, YAML::Old and YAML via the "class" option to parse the data with a more advanced YAML parser.

Danijel Tasov <data@cpan.org>

Mojolicious, Mojolicious::Plugin::JSONConfig, Mojolicious::Guides
2015-10-29 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.