X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FView%2FComponent%2FSubInclude.pm;h=6d04c87cb6b78d91cb89010510ee7ff1166d3df6;hb=e02835f505904212def30b3b62430d56a7597c71;hp=5d120121394b1f9c9e7450a6df7697f8468f4a57;hpb=35ebe0b6e30c6f6e1aaffd3aa9580dd9aa589d86;p=catagits%2FCatalyst-View-Component-SubInclude.git diff --git a/lib/Catalyst/View/Component/SubInclude.pm b/lib/Catalyst/View/Component/SubInclude.pm index 5d12012..6d04c87 100644 --- a/lib/Catalyst/View/Component/SubInclude.pm +++ b/lib/Catalyst/View/Component/SubInclude.pm @@ -15,11 +15,11 @@ Catalyst::View::Component::SubInclude - Use subincludes in your Catalyst views =head1 VERSION -Version 0.09 +Version 0.11 =cut -our $VERSION = '0.09'; +our $VERSION = '0.11'; $VERSION = eval $VERSION; =head1 SYNOPSIS @@ -49,11 +49,7 @@ in your page. It's built in an extensible way so that you're free to use sub-requests, Varnish ESI (L) or any other -sub-include plugin you might want to implement. An LWP plugin seems useful and -might be developed in the future. If you need to address a resource by it's -public path (i.e. the path part trailing C then you -will need to use L directly, and not this -component. +sub-include plugin you might want to implement. =head1 STASH FUNCTIONS @@ -168,8 +164,6 @@ has _subinclude_plugin_class_instance_cache => ( sub _subinclude_plugin_class_instance { my ($self, $plugin) = @_; - my $class = $plugin =~ /::/ ? $plugin : __PACKAGE__ . '::' . $plugin; - my $cache = $self->_subinclude_plugin_class_instance_cache; return $cache->{$plugin} if exists $cache->{$plugin}; @@ -177,10 +171,16 @@ sub _subinclude_plugin_class_instance { $self->subinclude->{ALL}||{}, $self->subinclude->{$plugin}||{} ); + my $short_class = $plugin_config->{'class'} ? + delete $plugin_config->{'class'} + : $plugin; + my $class = $short_class =~ /::/ ? + $short_class + : __PACKAGE__ . '::' . $short_class; Class::MOP::load_class($class); - return $cache->{$plugin} = $class->new($plugin_config); + return $cache->{$class} = $class->new($plugin_config); } =head1 SEE ALSO @@ -205,6 +205,10 @@ Nilson Santos Figueiredo Junior, C<< >> Tomas Doran (t0m) C<< >. +Vladimir Timofeev, C<< >>. + +Wallace Reis (wreis) C<< >>. + =head1 SPONSORSHIP Development sponsored by Ionzero LLC L.