__PACKAGE__->request_class('Catalyst::Request');
__PACKAGE__->response_class('Catalyst::Response');
-our $VERSION = '5.65';
+our $VERSION = '5.66';
sub import {
my ( $class, @arguments ) = @_;
sub plugin {
my ( $class, $name, $plugin, @args ) = @_;
- $class->_register_plugin($plugin, 1);
+ $class->_register_plugin( $plugin, 1 );
eval { $plugin->import };
$class->mk_classdata($name);
$namespace = '' if $path =~ /^\//;
$path =~ s/^\///;
- my $params = (scalar @args && ref $args[$#args] eq 'HASH' ? pop @args : {});
+ my $params =
+ ( scalar @args && ref $args[$#args] eq 'HASH' ? pop @args : {} );
# join args with '/', or a blank string
my $args = ( scalar @args ? '/' . join( '/', @args ) : '' );
{
my %PLUGINS;
- sub registered_plugins {
+
+ sub registered_plugins {
my $proto = shift;
return sort keys %PLUGINS unless @_;
my $plugin = shift;
message => qq/Couldn't load ${type}plugin "$plugin", $error/ );
}
- $PLUGINS{$plugin} = 1;
+ $PLUGINS{$plugin} = 1;
unless ($instant) {
no strict 'refs';
unshift @{"$class\::ISA"}, $plugin;
$self->{c} = File::Spec->catdir( $self->{mod}, 'Controller' );
$self->mk_dir( $self->{c} );
}
+ my $name = $self->{name};
+ $self->{rootname} =
+ $self->{short} ? "$name\::C::Root" : "$name\::Controller::Root";
$self->{base} = File::Spec->rel2abs( $self->{dir} );
}
sub _mk_rootclass {
my $self = shift;
- my $c = $self->{c};
- my $name = $self->{name};
- $self->{rootname} =
- $self->{short} ? "$name\::C::Root" : "$name\::Controller::Root";
- $self->render_file( 'rootclass', File::Spec->catfile( $c, "Root.pm" ) );
+ $self->render_file( 'rootclass',
+ File::Spec->catfile( $self->{c}, "Root.pm" ) );
}
sub _mk_makefile {
#
__PACKAGE__->setup;
+#
+# IMPORTANT: Please look into [% rootname %] for more
+#
+
=head1 NAME
[% name %] - Catalyst based application
Catalyst based application.
+=head1 SEE ALSO
+
+L<[% rootname %]>, L<Catalyst>
+
=head1 AUTHOR
[% author %]
use base 'Catalyst::Controller';
#
-# A empty namespace attaches this Controller to the root
+# Sets the actions in this controller to be registered with no prefix
+# so they function identically to actions created in MyApp.pm
#
__PACKAGE__->config->{namespace} = '';
=head1 NAME
-[% rootname %] - Root Controller of this Catalyst based application
+[% rootname %] - Root Controller for this Catalyst based application
=head1 SYNOPSIS
=head1 DESCRIPTION
-Root Controller of this Catalyst based application.
+Root Controller for this Catalyst based application.
=head1 METHODS