X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FResponse.pm;h=2d83a4801384538883baab581448709f64cd522a;hb=8c8f7c51b56863a2173c3d2fa6033107cf2c88cc;hp=a84e3c8225c3de855f4923da4b5ef727c5a3396c;hpb=06e1b6164a2c9d7b463f358b0d1934ef83a82845;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Response.pm b/lib/Catalyst/Response.pm index a84e3c8..2d83a48 100644 --- a/lib/Catalyst/Response.pm +++ b/lib/Catalyst/Response.pm @@ -3,7 +3,9 @@ package Catalyst::Response; use strict; use base 'Class::Accessor::Fast'; -__PACKAGE__->mk_accessors(qw/cookies headers output redirect status/); +__PACKAGE__->mk_accessors(qw/cookies body headers redirect status/); + +*output = \&body; sub content_encoding { shift->headers->content_encoding(@_) } sub content_length { shift->headers->content_length(@_) } @@ -39,9 +41,11 @@ to response data. =over 4 -=item $resp->body +=item $resp->body($text) + + $c->response->body('Catalyst rocks!'); -Shortcut for $resp->output. +Contains the final output. =item $resp->content_encoding @@ -71,11 +75,9 @@ Returns a L object containing the headers. $c->response->headers->header( 'X-Catalyst' => $Catalyst::VERSION ); -=item $resp->output($text) - -Contains the final output. +=item $resp->output - $c->response->output('Catalyst rocks!'); +Shortcut to $resp->body =item $resp->redirect($url)