This is a universal frontend for mod_perl1, mod_perl2, HTML::Mason and CGI.
-You can omit the Maypole::Plugin:: prefix from plugins.
-So Maypole::Plugin::Config::YAML becomes Config::YAML.
+Automatically determines the appropriate frontend for your environment (unless
+you want to use L<MasonX::Maypole>, in which case include C<MasonX> in the
+arguments).
+
+Loads plugins supplied in the C<use> statement.
+
+Responds to flags supplied in the C<use> statement.
+
+Initializes the application's configuration object.
+
+You can omit the Maypole::Plugin:: prefix from plugins. So
+Maypole::Plugin::Config::YAML becomes Config::YAML.
use Maypole::Application qw(Config::YAML);
use Maypole::Application qw(-Debug Config::YAML -Setup);
-The position of plugins and flags in the chain is important,
-because they are loaded/executed in the same order they appear.
+The position of plugins in the chain is important, because they are
+loaded/executed in the same order they appear.
+
+=head1 FRONTEND
+
+Under mod_perl (1 or 2), selects L<Apache::MVC>.
+
+Otherwise, selects L<CGI::Maypole>.
+
+If C<MasonX> is specified, sets L<MasonX::Maypole> as the frontend. This
+currently also requires a mod_perl environment.
+
+=head1 FLAGS
-=head2 -Setup
+=over
+
+=item -Setup
use Maypole::Application qw(-Setup);
required model config parameters are set in C<MyApp-E<gt>config>. See
L<Maypole::Config> for more information.
-=head2 -Init
+=item -Init
use Maypole::Application qw(-Setup -Init);
C<setup> and C<init>, probably by using one of the C<Maypole::Plugin::Config::*>
plugins.
-=head2 -Debug
+=item -Debug
use Maypole::Application qw(-Debug);
You can specify a higher debug level by saying C<-Debug2> etc.
+=back
+
+=head1 BeerDB
+
+The canonical example used in the Maypole documentation is the beer database,
+which starts like this:
+
+ package BeerDB;
+ use strict;
+ use warnings;
+
+ # choose a frontend, initialise the config object, and load a plugin
+ use Maypole::Application qw/Relationship/;
+
+ # get the empty config object created by Maypole::Application
+ my $config = __PACKAGE__->config;
+
+ # basic settings
+ $config->uri_base("http://localhost/beerdb");
+ $config->template_root("/path/to/templates");
+ $config->rows_per_page(10);
+ $config->display_tables([qw[beer brewery pub style]]);
+
+ # table relationships
+ $config->relationships([
+ "a brewery produces beers",
+ "a style defines beers",
+ "a pub has beers on handpumps",
+ ]);
+
+ # validation
+ BeerDB::Brewery->untaint_columns( printable => [qw/name notes url/] );
+ BeerDB::Pub->untaint_columns( printable => [qw/name notes url/] );
+ BeerDB::Style->untaint_columns( printable => [qw/name notes/] );
+ BeerDB::Beer->untaint_columns(
+ printable => [qw/abv name price notes/],
+ integer => [qw/style brewery score/],
+ date => [ qw/date/],
+ );
+
+ # set everything up
+ __PACKAGE__->setup("dbi:SQLite:t/beerdb.db");
+
+ 1;
+
=head1 AUTHOR
Sebastian Riedel, C<sri@oook.de>