This file documents the revision history for Perl extension Catalyst.
+5.59
+ - Fixed forward to classes ($c->forward(qw/MyApp foo/))
+
5.58 2005-11-24 10:51:00
- Added ExtUtils::AutoInstall support
- Allow overriding path in Catalyst::Helper.
__PACKAGE__->request_class('Catalyst::Request');
__PACKAGE__->response_class('Catalyst::Response');
-our $VERSION = '5.58';
+our $VERSION = '5.59';
sub import {
my ( $class, @arguments ) = @_;
unless ($result) {
- my $class = ref($command) || ref( $c->component($command) );
- my $method = shift || 'process';
+ my $class = ref($command)
+ || ref( $c->component($command) )
+ || $c->component($command);
+ my $method = shift || 'process';
unless ($class) {
my $error =
return $c->SUPER::execute(@_);
}
+sub class_forward_test_method {
+ my ( $self, $c ) = @_;
+ $c->response->headers->header( 'X-Class-Forward-Test-Method' => 1 );
+}
+
{
no warnings 'redefine';
sub Catalyst::Log::error { }
sub three : Local {
my ( $self, $c ) = @_;
- $c->forward($self, 'four');
+ $c->forward( $self, 'four' );
}
sub four : Private {
sub jojo : Local {
my ( $self, $c ) = @_;
$c->forward('one');
- $c->forward($c->controller('Action::Forward'), 'three');
+ $c->forward( $c->controller('Action::Forward'), 'three' );
}
sub inheritance : Local {
sub args_embed_relative : Local {
my ( $self, $c ) = @_;
- $c->forward( 'embed/ok' );
+ $c->forward('embed/ok');
}
sub args_embed_absolute : Local {
my ( $self, $c ) = @_;
- $c->forward( '/action/forward/embed/ok' );
+ $c->forward('/action/forward/embed/ok');
}
sub embed : Local {
my ( $self, $c, $ok ) = @_;
-
+
$ok ||= 'not ok';
- $c->res->body( $ok );
+ $c->res->body($ok);
+}
+
+sub class_forward_test_action : Local {
+ my ( $self, $c ) = @_;
+ $c->forward(qw/TestApp class_forward_test_method/);
}
1;
BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 2; }
-use Test::More tests => 44 * $iters;
+use Test::More tests => 47 * $iters;
use Catalyst::Test 'TestApp';
if ( $ENV{CAT_BENCHMARK} ) {
'Content is a serialized Catalyst::Request'
);
}
+
+ # test class forwards
+ {
+ ok(
+ my $response = request(
+ 'http://localhost/action/forward/class_forward_test_action'),
+ 'Request'
+ );
+ ok( $response->is_success, 'Response Successful 2xx' );
+ is( $response->header('X-Class-Forward-Test-Method'), 1,
+ 'Test Method' );
+ }
+
}