Ado

 view release on metacpan or  search on metacpan

lib/Ado.pm  view on Meta::CPAN



=head1 METHODS

Ado inherits all methods from Mojolicious and implements
the following new ones.


=head2 startup

Sets various default paths like C<templates>, C<site_templates>, C<public>.
Defines L<Mojolicious/secrets> as sha1_sum of C<$moniker.$mode. $home>.  Sets
L<Mojolicious/controller_class> and L<Mojolicious::Routes/namespaces> to
L<${CLASS}::Control>.  Sets L<Mojolicious::Plugins/namespaces> to
C<['Mojolicious::Plugin', "${CLASS}::Plugin"]>.  Sets
L<Mojolicious::Commands/namespaces> to C<${CLASS}::Command>.  C<$CLASS> is
usually L<Ado>.  Then calls the following methods in the order they are listed.
Returns void.

You can amend this behavior in the application configuration file.

=head2 load_config

Checks C<$ENV{MOJO_CONFIG}> and if not set sets it to
C<$app-E<gt>home/etc/ado.conf>.  Loads L<Mojolicious::Plugin::Config> to do the
rest of the dirty work.  Returns $app.

=head2 load_plugins

Does not accept any parameters.  Loads plugins listed in
C<$config-E<gt>{plugins}>.  C<$config-E<gt>{plugins}> is an C<ARRAYREF> in
which each element is a C<HASHREF> with keys C<name> and C<config> or string
representing the plugin name.  The name of the plugin is expected to be string
that can be passed to L<Mojolicious/plugin>.  The C<config> values is another
C<HASHREF> containing the configuration for the plugin.  Plugins can be
L<Mojolicious> or L<Ado> specific plugins.  Every L<Ado::Plugin>::Foo must
inherit from L<Ado::Plugin> which C<ISA> L<Mojolicious::Plugin>.  Of course
Mojolicious plugins can be used - we count on this.  There are plenty of
examples on CPAN.  Returns $app.

=head2 load_routes

Does not accept any parameters.  Loads predefined routes from
C<$config-E<gt>routes>.  C<$config-E<gt>routes> is an C<ARRAYREF> in which each
element is a C<HASHREF> with keys corresponding to a method name and value the
parameters that will be passed to the method. Currently we use the C<route>
value to pass it to L<Mojolicious::Routes/route>,C<params> value is the second
parameter to instantiate the route. C<via> and C<to> values are passed to the
newly created route.  See L<Mojolicious::Routes::Route> and
L<Mojolicious::Guides::Routing> for more.

Returns $app.

=head2 define_mime_types

Defines any MIME types listed in C<ado.conf> in C<types =E<gt> {...}>.  Returns
$app.

=head1 SPONSORS

The original author.

Become a sponsor and help make L<Ado> the ERP for the enterprise!

=head1 SEE ALSO

L<Mojolicious>, L<Ado::Manual>,
L<http://www.thefreedictionary.com/ado>,

=head1 AUTHOR

Красимир Беров (Krasimir Berov)

=head1 COPYRIGHT AND LICENSE

Copyright 2013-2016 Красимир Беров (Krasimir Berov).

This program is free software, you can redistribute it and/or modify it under
the terms of the GNU Lesser General Public License v3 (LGPL-3.0).  You may
copy, distribute and modify the software provided that modifications are open
source. However, software that includes the license may release under a
different license.

See http://opensource.org/licenses/lgpl-3.0.html for more information.

=cut



( run in 0.561 second using v1.01-cache-2.11-cpan-5837b0d9d2c )