Ado

 view release on metacpan or  search on metacpan

lib/Ado/Command/generate/adoplugin.pm  view on Meta::CPAN

L<Ado::Command::generate::crud>. It is mandatory to pass at least the
C<--tables> option so the controllers can be generated.

When generating a plugin:
C<--controller_namespace>
defaults to  C<app-E<gt>routes-E<gt>namespaces-E<gt>[0]>;
C<--home_dir> defaults to the plugin base directory;
C<--lib> defaults to C<lib> in the plugin base directory;
C<--model_namespace> defaults to L<Ado::Model>;
C<--templates_root> defaults to C<templates> in the plugin base directory.

=head1 ATTRIBUTES

L<Ado::Command::generate::adoplugin> inherits all attributes from
L<Ado::Command::generate> and implements the following new ones.

=head2 crud

  #returns $self.
  $self->crud(Ado::Command::generate::crud->new(app => $self->app))
  #returns Ado::Command::generate::crud instance.
  my $crud = $self->crud->run(%options);

An instance of L<Ado::Command::generate::crud>.
Used by L<Ado::Command::generate::adoplugin> to generate routes for controllers
and possibly others.

=head2 description

  my $description = $command->description;
  $command        = $command->description('Foo!');

Short description of this command, used for the command list.

=head2 usage

  my $usage = $command->usage;
  $command  = $command->usage('Foo!');

Usage information for this command, used for the help screen.

=head1 METHODS

L<Ado::Command::generate::adoplugin> inherits all methods from
L<Ado::Command> and implements the following new ones.

=head2 run

  $plugin->run(@ARGV);

Run this command.

=head1 SEE ALSO

L<Mojolicious::Command::generate::plugin>,
L<Ado::Command::generate::crud>,
L<Ado::Command::generate::apache2vhost>,
L<Ado::Command::generate::apache2htaccess>, L<Ado::Command::generate>,
L<Mojolicious::Command::generate>, L<Getopt::Long>,
L<Ado::Command> L<Ado::Manual>,
L<Mojolicious>, L<Mojolicious::Guides::Cookbook/DEPLOYMENT>

=head1 AUTHOR

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

=head1 COPYRIGHT AND LICENSE

Copyright 2014 Красимир Беров (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


__DATA__

@@ class
% my ($class, $name) = @_;
package <%= $class %>;
use Mojo::Base 'Ado::Plugin';
our $VERSION = '0.01';

sub register {
    my ($self, $app, $config) = shift->initialise(@_);
    # Do your magic here.
    # You may want to add some helpers
    # or some new complex routes definitions,
    # or register this plugin as a template renderer.
    # Look in Mojolicious and Ado sources for examples and inspiration.
    return $self;
}

1;

<% %>__END__

<% %>=encoding utf8

<% %>=head1 NAME

<%= $class %> - an Ado Plugin that does foooooo.

<% %>=head1 SYNOPSIS

  # $ENV{MOJO_HOME}/etc/ado.config
  plugins => {
    # other plugins here...
    '<%= $name %>',
    # other plugins here...
  }

<% %>=head1 DESCRIPTION



( run in 0.673 second using v1.01-cache-2.11-cpan-f56aa216473 )