$c->model('Foo')->do_stuff;
+Any extra arguments are directly passed to ACCEPT_CONTEXT.
+
If the name is omitted, it will look for
- a model object in $c->stash{current_model_instance}, then
- a model name in $c->stash->{current_model}, then
if $c->stash->{current_model_instance};
return $c->model( $c->stash->{current_model} )
if $c->stash->{current_model};
- return $c->model( $c->config->{default_model} )
- if $c->config->{default_model};
}
- return $c->_filter_component( $c->_comp_singular(qw/Model M/), @args );
+ return $c->model( $c->config->{default_model} )
+ if $c->config->{default_model};
+ return $c->_filter_component( $c->_comp_singular(qw/Model M/) );
}
$c->view('Foo')->do_stuff;
+Any extra arguments are directly passed to ACCEPT_CONTEXT.
+
If the name is omitted, it will look for
- a view object in $c->stash{current_view_instance}, then
- a view name in $c->stash->{current_view}, then
if $c->stash->{current_view_instance};
return $c->view( $c->stash->{current_view} )
if $c->stash->{current_view};
- return $c->view( $c->config->{default_view} )
- if $c->config->{default_view};
}
+ return $c->view( $c->config->{default_view} )
+ if $c->config->{default_view};
return $c->_filter_component( $c->_comp_singular(qw/View V/) );
}
if ( my $location = $c->response->redirect ) {
$c->log->debug(qq/Redirecting to "$location"/) if $c->debug;
$c->response->header( Location => $location );
+
+ if ( !$c->response->body ) {
+ # Add a default body if none is already present
+ $c->response->body(
+ "<p>This item has moved <a href=\"$location\">here</a>.</p>"
+ );
+ }
}
# Content-Length