Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added plugin namespace examples

  • Loading branch information...
commit 1f4af901a71b5f12dae9516243d07fe484570153 1 parent e2182b1
@kraih authored
View
5 lib/Mojolicious.pm
@@ -258,7 +258,7 @@ following new ones.
Command line interface for your application, defaults to a
L<Mojolicious::Commands> object.
- # Add another namespace to search for commands
+ # Add another namespace to load commands from
push @{$app->commands->namespaces}, 'MyApp::Command';
=head2 C<controller_class>
@@ -302,6 +302,9 @@ The plugin loader, defaults to a L<Mojolicious::Plugins> object. You can
usually leave this alone, see L<Mojolicious::Plugin> if you want to write a
plugin or the C<plugin> method below if you want to load a plugin.
+ # Add another namespace to load plugins from
+ push @{$app->plugins->namespaces}, 'MyApp::Plugin';
+
=head2 C<renderer>
my $renderer = $app->renderer;
View
6 lib/Mojolicious/Commands.pm
@@ -300,10 +300,10 @@ Short usage message shown before listing available commands.
my $namespaces = $commands->namespaces;
$commands = $commands->namespaces(['Mojolicious::Commands']);
-Namespaces to search for available commands, defaults to
-C<Mojolicious::Command> and C<Mojo::Command>.
+Namespaces to load commands from, defaults to C<Mojolicious::Command> and
+C<Mojo::Command>.
- # Add another namespace to search for commands
+ # Add another namespace to load commands from
push @{$commands->namespaces}, 'MyApp::Command';
=head1 METHODS
View
5 lib/Mojolicious/Plugins.pm
@@ -90,9 +90,10 @@ L<Mojolicious::Plugins> implements the following attributes.
my $namespaces = $plugins->namespaces;
$plugins = $plugins->namespaces(['Mojolicious::Plugin']);
-Namespaces to load plugins from.
+Namespaces to load plugins from, defaults to L<Mojolicious::Plugin>.
- push @{$plugins->namespaces}, 'MyApp::Plugins';
+ # Add another namespace to load plugins from
+ push @{$plugins->namespaces}, 'MyApp::Plugin';
=head1 METHODS
Please sign in to comment.
Something went wrong with that request. Please try again.