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%2FVisit.pm;h=5cfc85a8cff9419184486a034cd5930379d8e635;hp=7ffae03cc9a237b2bd924849f2e9a779c753e5a9;hb=f97c716560e114d118695339a200fe5a7e09e9e5;hpb=8bbd65bf6b13d05aae77781463bc43f3c0a44deb diff --git a/lib/Catalyst/View/Component/SubInclude/Visit.pm b/lib/Catalyst/View/Component/SubInclude/Visit.pm index 7ffae03..5cfc85a 100644 --- a/lib/Catalyst/View/Component/SubInclude/Visit.pm +++ b/lib/Catalyst/View/Component/SubInclude/Visit.pm @@ -1,6 +1,7 @@ package Catalyst::View::Component::SubInclude::Visit; use Moose; use Carp qw/croak/; +use MooseX::Types::Moose qw/ Bool /; use namespace::clean -except => 'meta'; =head1 NAME @@ -56,14 +57,20 @@ with the other plugins. =cut +has keep_stash => ( + isa => Bool, + is => 'ro', + default => 0, +); + sub generate_subinclude { - my ($class, $config, $c, $path, @params) = @_; + my ($self, $c, $path, @params) = @_; croak "subincludes through visit() require Catalyst version 5.71000 or newer" unless $c->can('visit'); { - local $c->{stash} = $config->{keep_stash} ? $c->{stash} : {}; + local $c->{stash} = $self->keep_stash ? $c->{stash} : {}; local $c->request->{parameters} = ref $params[-1] eq 'HASH' ? pop @params : {};