X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-View-Component-SubInclude.git;a=blobdiff_plain;f=lib%2FCatalyst%2FView%2FComponent%2FSubInclude.pm;h=f5684836f68e454fb644814ac0372607aecc4091;hp=20f3de5a231a6048c069957eaa486b1c59efe341;hb=f91a7d21c753463d37f02cf9642ca80ddf0dadc7;hpb=84616d2a8aa249873c1b4b5524234e30956eee9e diff --git a/lib/Catalyst/View/Component/SubInclude.pm b/lib/Catalyst/View/Component/SubInclude.pm index 20f3de5..f568483 100644 --- a/lib/Catalyst/View/Component/SubInclude.pm +++ b/lib/Catalyst/View/Component/SubInclude.pm @@ -2,7 +2,8 @@ package Catalyst::View::Component::SubInclude; use Moose::Role; use Carp qw/croak/; -use namespace::clean qw/croak/; +use Scalar::Util qw/weaken/; +use namespace::clean -except => 'meta'; =head1 NAME @@ -10,11 +11,11 @@ Catalyst::View::Component::SubInclude - Use subincludes in your Catalyst views =head1 VERSION -Version 0.04 +Version 0.07 =cut -our $VERSION = '0.04'; +our $VERSION = '0.07'; =head1 SYNOPSIS @@ -104,7 +105,7 @@ in runtime. It expects a fully qualified class name. has 'subinclude_plugin' => ( is => 'rw', - isa => 'ClassName' + isa => 'Str' ); around 'new' => sub { @@ -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, @_ ) };