make config less gross and work with ConfigLoader
[catagits/Catalyst-View-Component-SubInclude.git] / lib / Catalyst / View / Component / SubInclude.pm
index 840cfa9..5d12012 100644 (file)
@@ -15,11 +15,11 @@ Catalyst::View::Component::SubInclude - Use subincludes in your Catalyst views
 
 =head1 VERSION
 
-Version 0.07_01
+Version 0.09
 
 =cut
 
-our $VERSION = '0.07_02';
+our $VERSION = '0.09';
 $VERSION = eval $VERSION;
 
 =head1 SYNOPSIS
@@ -47,10 +47,13 @@ L<Moose::Role|Moose::Role>, so using L<Moose|Moose> in your view is required.
 Simply put, it's a way to include the output of a Catalyst sub-request somewhere
 in your page.
 
-It's built in an extensible way so that you're free to use sub-requests, Varnish
-ESI (L<http://www.catalystframework.org/calendar/2008/17>) or any other
+It's built in an extensible way so that you're free to use sub-requests,
+Varnish ESI (L<http://www.catalystframework.org/calendar/2008/17>) or any other
 sub-include plugin you might want to implement. An LWP plugin seems useful and
-might be developed in the future.
+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<http://example.com/myapp> then you
+will need to use L<Catalyst::Plugin::SubRequest> directly, and not this
+component.
 
 =head1 STASH FUNCTIONS
 
@@ -113,6 +116,12 @@ has 'subinclude_plugin' => (
     isa => Str,
 );
 
+has subinclude => (
+    is => 'ro',
+    isa => HashRef,
+    default => sub { {} },
+);
+
 around 'new' => sub {
     my $next = shift;
     my $class = shift;
@@ -165,8 +174,8 @@ sub _subinclude_plugin_class_instance {
     return $cache->{$plugin} if exists $cache->{$plugin};
 
     my $plugin_config = Catalyst::Utils::merge_hashes(
-        $self->config->{subinclude}->{ALL}||{},
-        $self->config->{subinclude}->{$plugin}||{}
+        $self->subinclude->{ALL}||{},
+        $self->subinclude->{$plugin}||{}
     );
 
     Class::MOP::load_class($class);