X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FView%2FTT.pm;h=eebe59a2328a0cccc7ba20654799d3ee81db2cb3;hb=46cdc47d1c4ef7b18572019b9b904d84f6e45584;hp=adacc1cd64eba3eb5594b3306963de866986b563;hpb=c577e7b8708946025222345164f8c79c0940c736;p=catagits%2FCatalyst-View-TT.git diff --git a/lib/Catalyst/View/TT.pm b/lib/Catalyst/View/TT.pm index adacc1c..eebe59a 100644 --- a/lib/Catalyst/View/TT.pm +++ b/lib/Catalyst/View/TT.pm @@ -13,6 +13,7 @@ use Scalar::Util qw/blessed/; our $VERSION = '0.34'; __PACKAGE__->mk_accessors('template'); +__PACKAGE__->mk_accessors('expose_methods'); __PACKAGE__->mk_accessors('include_path'); *paths = \&include_path; @@ -128,6 +129,7 @@ sub new { # Set base include paths. Local'd in render if needed $self->include_path($config->{INCLUDE_PATH}); + $self->expose_methods($config->{expose_methods}); $self->config($config); # Creation of template outside of call to new so that we can pass [ $self ] @@ -273,9 +275,9 @@ sub template_vars { name => $c->config->{name} ); - if ($self->config->{expose_methods}) { + if ($self->expose_methods) { my $meta = $self->meta; - foreach my $method_name (@{$self->config->{expose_methods}}) { + foreach my $method_name (@{$self->expose_methods}) { my $method = $meta->get_method( $method_name ); unless ($method) { Catalyst::Exception->throw( "$method_name not found in TT view" );