NAME
Mojolicious::Plugin::ModeSwitcher - Configuration change by MOJO_MODE
ARGUMENTS
file
Reads the yml/json stream from a file instead of a string
reload
Reload configuration
include
If your configuration has a file.(yml|json), ModeSwitcher replace the value of the contents of the file
eval
Eval code
SPECIAL NAMES
If your configuration has static_path or templates_path, ModeSwitcher will make the:
push @{ $app->renderer->paths }, $conf->{templates_path}
push @{ $app->static->paths }, $conf->{static_path}
SYNOPSIS
$self->plugin( 'ModeSwitcher' );
...
$self->switch_config(
file => 'etc/conf.yml'
eval => {
development => {
code => '..',
key => 'db'
},
production => { code => '..' }
},
);
...
print self->stash( 'switch_config' )->{db_name};
AUTHOR
Grishkovelli grishkovelli@gmail.com
Git
https://github.com/grishkovelli/Mojolicious-Plugin-ModeSwitcher
COPYRIGHT
Copyright (C) 2013, Grishkovelli.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.