X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FView%2FComponent%2FSubInclude.pm;h=ecdeff019acb8e56a37e380cee083e12e0e43dac;hb=9399de67c73e690611087f7aa359537a7bef4b46;hp=e4505e064b1e91c625aa61b732e86060578c8c82;hpb=7c937cccd1caf12c59b11f07ee76144f770b3ad8;p=catagits%2FCatalyst-View-Component-SubInclude.git diff --git a/lib/Catalyst/View/Component/SubInclude.pm b/lib/Catalyst/View/Component/SubInclude.pm index e4505e0..ecdeff0 100644 --- a/lib/Catalyst/View/Component/SubInclude.pm +++ b/lib/Catalyst/View/Component/SubInclude.pm @@ -3,6 +3,7 @@ use Moose::Role; use Carp qw/croak/; use namespace::clean qw/croak/; +use Scalar::Util qw/weaken/; =head1 NAME @@ -10,11 +11,11 @@ Catalyst::View::Component::SubInclude - Use subincludes in your Catalyst views =head1 VERSION -Version 0.05 +Version 0.07 =cut -our $VERSION = '0.05'; +our $VERSION = '0.07'; =head1 SYNOPSIS @@ -122,7 +123,9 @@ around 'new' => sub { around 'render' => sub { my $next = shift; my ($self, $c, @args) = @_; - + + weaken $c; + $c->stash->{subinclude} = sub { $self->_subinclude( $c, @_ ) }; $c->stash->{subinclude_using} = sub { $self->_subinclude_using( $c, @_ ) };