Ado

 view release on metacpan or  search on metacpan

lib/Ado/Manual/Plugins.pod  view on Meta::CPAN

=pod

=encoding utf8

=head1 NAME

Ado::Manual::Plugins - Ado plugins and how to write an Ado::Plugin

=head1 DESCRIPTION

C<@Ado::ISA=qw(Mojolicious)>. It is distributed together with a few plugins to
make it usable as a basic Mojolicious application. Theoretically all of the
plugins, distributed with L<Ado> could be disabled so you can start your project
only as a bare (I<but full>) L<Mojolicious> application, if you wish.  Later you
can decide to enable some of them and eventually add (your own) L<Mojolicious>
or L<Ado> plugins. Here is how it looks.

=for HTML <img src="https://raw.githubusercontent.com/kberov/Ado/master/public/img/Ado-Building-Blocks.png" />

=head1 PLUGINS

Ado comes with the following default plugins. They can be used as examples and
for inspiration.

=over

=item * L<Ado::Plugin::AdoHelpers> - Default Ado helpers

=item * L<Ado::Plugin::Auth> - Authenticate users

=item * L<Ado::Plugin::I18n> - Internationalization and localization for Ado

=item * L<Ado::Plugin::MarkDownRenderer> - Render markdown to HTML

=item * L<Ado::Plugin::Routes> - Keep routes in their own configuration file separately

=item * L<Ado::Control::Test> - A controller used for testing Ado
(not a plugin by it self)

=back

The following plugins are written by me and are distributed separately. You can
install and use them in your application. Please help make them better.

=over

=item * L<Ado::Plugin::Admin> - system (site) administration user interface.

=item * L<Ado::Plugin::Site> - Manage your Sites.

=item * L<Ado::Plugin::Vest> - Messaging services for an Ado system!

=back

Do not hesitate to contact the Ado team and request your plugin to be added
to the above list.

=head1 WRITING A PLUGIN

There is I<almost> nothing special about writing an L<Ado::Plugin>. The only
difference between Ado and Mojolicious plugins is that Ado plugins can
retrieve their settings from their own configuration files.

The configuration file must be named after the respective plugin. A plugin
Ado::Plugin::Hello (when installed) will search its configuration in
C<app-E<gt>home-E<gt>rel_dir('etc/plugins/hello.conf')>. depending on the
current mode (C<$ENV{MOJO_MODE}>). The file
C<app-E<gt>home-E<gt>rel_dir('etc/plugins/hello.$ENV{MOJO_MODE}.conf')> will
also be loaded and will override all settings from
C<app-E<gt>home-E<gt>rel_dir('etc/plugins/hello.conf')>. The file must return
a HASHREF. See the code of the listed plugins below for examples of how and
what can be done in a plugin.

To create your own plugin do the following (Example):



( run in 1.614 second using v1.01-cache-2.11-cpan-98e64b0badf )