Skip to content

Commit

Permalink
more details about how configuration filenames are generated
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Feb 10, 2014
1 parent ed9cb42 commit 8cec8d3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions lib/Mojolicious/Guides/Rendering.pod
Expand Up @@ -1010,8 +1010,8 @@ plugin.

Adding a configuration file to your application is as easy as adding a file to
its home directory and loading the plugin L<Mojolicious::Plugin::Config>. The
default name is the same as that of your application script (C<myapp.pl>), but
with a C<.conf> extension (C<myapp.conf>).
default name is based on L<Mojolicious/"moniker">, appended with a C<.conf>
extension (C<myapp.conf>).

$ echo '{name => "my Mojolicious application"};' > myapp.conf

Expand All @@ -1037,7 +1037,7 @@ the helper L<Mojolicious::Plugin::DefaultHelpers/"config">
<body>Welcome to <%= config 'name' %></body>
</html>

Alternatively you can also have configuration files in the JSON format with
Alternatively you can also use configuration files in the JSON format with
L<Mojolicious::Plugin::JSONConfig>.

=head1 ADVANCED
Expand Down
6 changes: 3 additions & 3 deletions lib/Mojolicious/Plugin/Config.pm
Expand Up @@ -97,8 +97,8 @@ L<Mojolicious::Plugin::Config> is a Perl-ish configuration plugin.
The application object can be accessed via C<$app> or the C<app> function,
L<strict>, L<warnings>, L<utf8> and Perl 5.10 features are automatically
enabled. You can extend the normal configuration file C<myapp.conf> with
C<mode> specific ones like C<myapp.$mode.conf>. A default configuration
enabled. You can extend the normal configuration file C<$moniker.conf> with
C<mode> specific ones like C<$moniker.$mode.conf>. A default configuration
filename will be generated from the value of L<Mojolicious/"moniker">.
The code of this plugin is a good example for learning to build new plugins,
Expand Down Expand Up @@ -132,7 +132,7 @@ File extension for generated configuration filenames, defaults to C<conf>.
plugin Config => {file => '/etc/foo.stuff'};
Full path to configuration file, defaults to the value of the MOJO_CONFIG
environment variable or C<myapp.conf> in the application home directory.
environment variable or C<$moniker.conf> in the application home directory.
=head1 METHODS
Expand Down
6 changes: 3 additions & 3 deletions lib/Mojolicious/Plugin/JSONConfig.pm
Expand Up @@ -72,9 +72,9 @@ L<Mojolicious::Plugin::JSONConfig> is a JSON configuration plugin that
preprocesses its input with L<Mojo::Template>.
The application object can be accessed via C<$app> or the C<app> function. You
can extend the normal configuration file C<myapp.json> with C<mode> specific
ones like C<myapp.$mode.json>. A default configuration filename will be
generated from the value of L<Mojolicious/"moniker">.
can extend the normal configuration file C<$moniker.json> with C<mode>
specific ones like C<$moniker.$mode.json>. A default configuration filename
will be generated from the value of L<Mojolicious/"moniker">.
The code of this plugin is a good example for learning to build new plugins,
you're welcome to fork it.
Expand Down

0 comments on commit 8cec8d3

Please sign in to comment.