# HG changeset patch # User sergey # Date 1381957477 -14400 # Node ID 8dfb9df07d02d5989ebd2a162ce1fbddbd269530 # Parent 9330835535b9f0aebc1d5bb85bf9a9fb86b9855a added support for the custom resolvers for the TTView diff -r 9330835535b9 -r 8dfb9df07d02 Lib/IMPL/Web/View/TTContext.pm --- 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); diff -r 9330835535b9 -r 8dfb9df07d02 _test/test_binding.pl --- 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; diff -r 9330835535b9 -r 8dfb9df07d02 deps.txt --- /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