From: Tomas Doran Date: Wed, 8 Dec 2010 21:06:00 +0000 (+0800) Subject: make config less gross and work with ConfigLoader X-Git-Tag: 0.10~1^2~8^2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-View-Component-SubInclude.git;a=commitdiff_plain;h=35ebe0b6e30c6f6e1aaffd3aa9580dd9aa589d86 make config less gross and work with ConfigLoader --- diff --git a/lib/Catalyst/View/Component/SubInclude.pm b/lib/Catalyst/View/Component/SubInclude.pm index efd8b33..5d12012 100644 --- a/lib/Catalyst/View/Component/SubInclude.pm +++ b/lib/Catalyst/View/Component/SubInclude.pm @@ -116,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; @@ -168,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);