changeset 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
files Lib/IMPL/Web/View/TTContext.pm _test/test_binding.pl deps.txt
diffstat 3 files changed, 12 insertions(+), 4 deletions(-) [+]
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);
--- a/_test/test_binding.pl	Wed Oct 16 17:28:40 2013 +0400
+++ b/_test/test_binding.pl	Thu Oct 17 01:04:37 2013 +0400
@@ -12,7 +12,7 @@
 BEGIN {
 	public property name => PROP_ALL;
 	public property age => PROP_ALL;
-	public property address => PROP_ALL|PROP_LIST, {type => 'Address'};
+	public property address => { get => 1, set => 1, isList => 1, type => 'Address'};
 }
 
 package Address;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/deps.txt	Thu Oct 17 01:04:37 2013 +0400
@@ -0,0 +1,8 @@
+Class::Accessor
+Template
+XML::Writer
+JSON
+DBIx::Class
+DateTime::Format::Parser
+DateTime::Format::MySQL
+Sub::Name
\ No newline at end of file