diff Lib/IMPL/Web/View/TTContext.pm @ 355:8dfb9df07d02

added support for the custom resolvers for the TTView
author sergey
date Thu, 17 Oct 2013 01:04:37 +0400
parents 9330835535b9
children 97131d500f16
line wrap: on
line diff
--- a/Lib/IMPL/Web/View/TTContext.pm	Wed Oct 16 17:28:40 2013 +0400
+++ b/Lib/IMPL/Web/View/TTContext.pm	Thu Oct 17 01:04:37 2013 +0400
@@ -34,7 +34,6 @@
 	   includes
 	   modules
 	   aliases
-	   resolver
 	)) {
 		my $t = $prop;
 		
@@ -149,6 +148,7 @@
 		};
 	}
 	
+	$template ||= $info->{template};
 	$template = $template ? $this->find_template($template) : $this->find_template_for($info->{model});
 	
 	return $this->render(
@@ -290,8 +290,8 @@
 	
 	#TODO handle DOM models
 	
-	if (my $resolver = $this->resolver) {
-		return $this->$resolver($prefix,$args);
+	if (my $res = $this->stash->get(['resolver', [$this,$prefix,$args]] ) ) {
+		return $res;
 	}
 	
 	my @comp = map { $_, 0 } grep length($_), split(/\.|\[(\d+)\]/, $prefix);