formatting fixed; pod for view and model methods in Catalyst.pm
Zbigniew Łukasiak [Wed, 18 Nov 2009 21:35:02 +0000 (21:35 +0000)]
lib/Catalyst.pm
lib/Catalyst/Dispatcher.pm

index 78d2629..c0ad6b8 100644 (file)
@@ -291,6 +291,12 @@ sub controller {
     return $c->component( $c->action->class );
 }
 
+=head2 $c->view($name)
+
+Gets a L<Catalyst::View> instance by name.
+
+=cut
+
 sub view {
     my ( $c, $name, @args ) = @_;
 
@@ -315,6 +321,12 @@ sub view {
     return $c->_filter_component( $comp );
 }
 
+=head2 $c->model($name)
+
+Gets a L<Catalyst::Model> instance by name.
+
+=cut
+
 sub model {
     my ( $c, $name, @args ) = @_;
     if( $name ) {
index d5d8375..1c1760b 100644 (file)
@@ -323,18 +323,15 @@ sub _invoke_as_component {
         my $possible_action = $c->application->action_for($method); 
         return $possible_action if $possible_action; 
         if( my $code = $c->application->can($method) ){ 
-  return $self->_method_action_class->new( 
-  { 
-  name => $method, 
-  code => $code, 
-  reverse => "$component_or_class->$method", 
-  class => $component_or_class, 
-  namespace => Catalyst::Utils::class2prefix( 
-  $component_or_class
-  ), 
-  } 
-  ); 
-  } 
+            return $self->_method_action_class->new( { 
+                    name => $method, 
+                    code => $code, 
+                    reverse => "$component_or_class->$method", 
+                    class => $component_or_class, 
+                    namespace => Catalyst::Utils::class2prefix( $component_or_class ), 
+                } 
+            ); 
+        } 
     } 
     my $component = $self->_find_component($c, $component_or_class);
     my $component_class = blessed $component || return 0;