handles => [
qw/
controllers
+ controller
models
views
component
use_stats
stats_class
set_action
+ registered_plugins
ran_setup
_comp_search_prefixes
# For statistics
our $RECURSION = 1000;
-our $DETACH = Catalyst::Exception::Detach->new;
-our $GO = Catalyst::Exception::Go->new;
=head1 METHODS
=cut
-sub controller {
- my ( $c, $name, @args ) = @_;
-
- if( $name ) {
- my @result = $c->_comp_search_prefixes( $name, qw/Controller C/ );
- return map { $c->_filter_component( $_, @args ) } @result if ref $name;
- return $c->_filter_component( $result[ 0 ], @args );
- }
-
- return $c->component( $c->action->class );
-}
-
=head2 $c->model($name)
Gets a L<Catalyst::Model> instance by name.
sub view {
my ( $c, $name, @args ) = @_;
- my $appclass = ref($c) || $c;
if( $name ) {
my @result = $c->_comp_search_prefixes( $name, qw/View V/ );
return map { $c->_filter_component( $_, @args ) } @result if ref $name;
return $c->view( $c->stash->{current_view} )
if $c->stash->{current_view};
}
- return $c->view( $appclass->config->{default_view} )
- if $appclass->config->{default_view};
-
+ return $c->view( $c->config->{default_view} )
+ if $c->config->{default_view};
my( $comp, $rest ) = $c->_comp_search_prefixes( undef, qw/View V/);
if( $rest ) {