my ( $c, $name, @args ) = @_;
if (ref $c && !$name) {
- return $c->stash->{current_model_instance}
- if $c->stash->{current_model_instance};
+ my $current_instance = $c->stash->{current_model_instance};
+ return $current_instance
+ if $current_instance;
- $name = $c->stash->{current_model}
- if $c->stash->{current_model};
+ $name = $c->stash->{current_model};
}
return $c->container->get_component_from_sub_container( 'model', $name, $c, @args);
my ( $c, $name, @args ) = @_;
if (ref $c && !$name) {
- return $c->stash->{current_view_instance}
- if $c->stash->{current_view_instance};
+ my $current_instance = $c->stash->{current_view_instance};
+ return $current_instance
+ if $current_instance;
- $name = $c->stash->{current_view}
- if $c->stash->{current_view};
+ $name = $c->stash->{current_view};
}
return $c->container->get_component_from_sub_container( 'view', $name, $c, @args);
my $container_class = Class::MOP::load_first_existing_class(@container_classes);
- my $container = $container_class->new( %args, name => "$class" );
+ my $container = $container_class->new( %args, application_name => "$class", name => "$class" );
$class->container($container);
my $config = $container->resolve(service => 'config');
=cut
sub setup_components {
- my $class = shift;
- # FIXME - I believe I shouldn't be handing $class over
- # Just don't know how to solve this.
- return $class->container->setup_components( $class );
+ shift->container->setup_components();
}
# FIXME - removed locate_components