diff Lib/IMPL/Web/View/TTControl.pm @ 185:ae8072f2f2a3

IMPL::Web::View::TTDocument tests, fixes
author cin
date Thu, 29 Mar 2012 18:22:15 +0400
parents 47dac58691ee
children 6c0fee769b0c
line wrap: on
line diff
--- a/Lib/IMPL/Web/View/TTControl.pm	Thu Mar 29 01:54:20 2012 +0400
+++ b/Lib/IMPL/Web/View/TTControl.pm	Thu Mar 29 18:22:15 2012 +0400
@@ -47,7 +47,19 @@
 		return $this->context->process( $body, { this => $this } );
 	} else {
 		return "";
-	}
+	}	
+}
+
+sub AUTOLOAD {
+	our $AUTOLOAD;
+	
+	my $method = ($AUTOLOAD =~ m/(\w+)$/)[0];
+	
+	return if $method eq 'DESTROY';
+	
+	my $res = $_[0]->template->$method();
+	
+	return defined($res) ? $res : $_[0]->context->stash->get($method);
 	
 }