X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FManual%2FIntro.pod;h=6bbebde0959bfbdbef443812f08b6b05b32cd393;hp=a4419b2f3bdfe3c04d5c5212272ba56f43ac70fb;hb=5403ad4276fae2b6cca25c6d0d7c388f71fdd4bb;hpb=3c4913b0cf663f6b0f0d55d02ea721da9feede76 diff --git a/lib/Catalyst/Manual/Intro.pod b/lib/Catalyst/Manual/Intro.pod index a4419b2..6bbebde 100644 --- a/lib/Catalyst/Manual/Intro.pod +++ b/lib/Catalyst/Manual/Intro.pod @@ -1067,18 +1067,18 @@ per request you can use the following technique: Add a field to C<$c>, like C. Then write your C method to look like this: - sub ACCEPT_CONTEXT { - my ( $self, $c ) = @_; - - if ( my $per_request = $c->my_model_instance ) { - return $per_request; - } else { - my $new_instance = bless { %$self, c => $c }, ref($self); - Scalar::Util::weaken($new_instance->{c}); # or we have a circular reference - $c->my_model_instance( $new_instance ); - return $new_instance; - } - } + sub ACCEPT_CONTEXT { + my ( $self, $c ) = @_; + + if ( my $per_request = $c->my_model_instance ) { + return $per_request; + } else { + my $new_instance = bless { %$self, c => $c }, ref($self); + Scalar::Util::weaken($new_instance->{c}); # or we have a circular reference + $c->my_model_instance( $new_instance ); + return $new_instance; + } + } =head3 Testing