From: Zbigniew Łukasiak Date: Wed, 18 Nov 2009 21:35:02 +0000 (+0000) Subject: formatting fixed; pod for view and model methods in Catalyst.pm X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9bbc3a9d5246b99184ef29df079464e036719562;hp=bbc249c902428383aca5a470c40ad4c646158ead;p=catagits%2FCatalyst-Runtime.git formatting fixed; pod for view and model methods in Catalyst.pm --- diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 78d2629..c0ad6b8 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -291,6 +291,12 @@ sub controller { return $c->component( $c->action->class ); } +=head2 $c->view($name) + +Gets a L 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 instance by name. + +=cut + sub model { my ( $c, $name, @args ) = @_; if( $name ) { diff --git a/lib/Catalyst/Dispatcher.pm b/lib/Catalyst/Dispatcher.pm index d5d8375..1c1760b 100644 --- a/lib/Catalyst/Dispatcher.pm +++ b/lib/Catalyst/Dispatcher.pm @@ -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;