X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FController.pm;h=b51f3f344e1df64e9376183c95bb60cdb5216ffe;hb=27ae4114b8e3c345e2593732333356bc842c2e77;hp=f98a8d55cc674384ac5b7ec86ffb3b255732ed9d;hpb=9ab7d83d1c7106860b01e3c17c334a2794d9bd0a;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Controller.pm b/lib/Catalyst/Controller.pm index f98a8d5..b51f3f3 100644 --- a/lib/Catalyst/Controller.pm +++ b/lib/Catalyst/Controller.pm @@ -52,9 +52,9 @@ Catalyst::Controller - Catalyst Controller base class package MyApp::Controller::Search use base qw/Catalyst::Controller/; - sub foo : Local { + sub foo : Local { my ($self,$c,@args) = @_; - ... + ... } # Dispatches to /search/foo =head1 DESCRIPTION @@ -127,7 +127,7 @@ sub action_for { return $app->dispatcher->get_action($name, $self->action_namespace); } -#my opinion is that this whole sub really should be a builder method, not +#my opinion is that this whole sub really should be a builder method, not #something that happens on every call. Anyone else disagree?? -- groditi ## -- apparently this is all just waiting for app/ctx split around action_namespace => sub { @@ -177,7 +177,7 @@ around path_prefix => sub { sub get_action_methods { my $self = shift; my $meta = find_meta($self); - confess("Metaclass for " . ref($meta) ." for " . $meta->name + confess("Metaclass for " . ref($meta) ." for " . $meta->name . " cannot support register_actions.") unless $meta->can('get_all_methods_with_attributes'); my @methods = $meta->get_all_methods_with_attributes; @@ -194,7 +194,6 @@ sub register_action_methods { my $class = ref $self || $self; #this is still not correct for some reason. my $namespace = $self->action_namespace($c); - my @methods = $meta->get_all_methods_with_attributes; foreach my $method (@methods) { my $name = $method->name; @@ -331,7 +330,7 @@ sub _parse_LocalRegex_attr { my $prefix = $self->path_prefix( $c ); $prefix .= '/' if length( $prefix ); - + return ( 'Regex', "^${prefix}${value}" ); } @@ -411,7 +410,7 @@ controller name. For instance controller 'MyApp::Controller::Foo::Bar' will be bound to 'foo/bar'. The default Root controller is an example of setting namespace to '' (the null string). -=head2 path +=head2 path Sets 'path_prefix', as described below.