diff Lib/IMPL/Web/View/TTControl.pm @ 189:08015e2803f1

IMPL::Vew::Web - fixed memory leaks, more tests
author cin
date Wed, 04 Apr 2012 02:49:45 +0400
parents 029c9610528c
children 78a18a2b6266
line wrap: on
line diff
--- a/Lib/IMPL/Web/View/TTControl.pm	Tue Apr 03 20:08:42 2012 +0400
+++ b/Lib/IMPL/Web/View/TTControl.pm	Wed Apr 04 02:49:45 2012 +0400
@@ -36,7 +36,7 @@
 	
 	if ( my $ctor = $template->blocks->{CTOR} ) {
 		$context->process($ctor, { this => $this } );
-		$this->templateVars('this',undef);
+		$context->stash->set('this',undef);
 	}
 	
 	$this->id($name . "-" . _GetNextId()) unless $this->id;
@@ -50,17 +50,6 @@
 	}
 );
 
-sub templateVars {
-	my $this = shift;
-	my $name = shift;
-	
-	if (@_) {
-		return $this->context->stash->set($name, shift);		
-	} else {
-		return $this->context->stash->get($name);
-	}
-}
-
 sub renderBlock {
 	$_[0]->template->blocks->{RENDER};
 }
@@ -71,7 +60,7 @@
 	$args = {} unless ref $args eq 'HASH';
 	
 	if(my $body = $this->renderBlock ) {
-		return $this->context->include( $body, { %$args, this => $this, template => $this->template } );
+		return $this->context->include( $body, { %$args, this => $this, template => $this->template, document => $this->document } );
 	} else {
 		return "";
 	}