Mercurial > pub > Impl
comparison Lib/IMPL/Web/View/TTControl.pm @ 359:833e663796c4
TTView: added view variable to pass rendering context between controls
TTView: display function renamed to display_for
WebResource: resources now marked with roles for searching a desired resource by a role in the resource chain
author | sergey |
---|---|
date | Mon, 25 Nov 2013 02:19:31 +0400 |
parents | 97131d500f16 |
children |
comparison
equal
deleted
inserted
replaced
358:248f95c1762a | 359:833e663796c4 |
---|---|
18 }; | 18 }; |
19 | 19 |
20 our $AUTOLOAD_REGEX = qr/^[a-z]/; | 20 our $AUTOLOAD_REGEX = qr/^[a-z]/; |
21 | 21 |
22 sub CTOR { | 22 sub CTOR { |
23 my ($this,$context,$template) = @_; | 23 my ($this,$context,$template,$args) = @_; |
24 | 24 |
25 $this->context($context) | 25 $this->context($context) |
26 or die ArgException->new(context => 'A context is required'); | 26 or die ArgException->new(context => 'A context is required'); |
27 $this->template($template) | 27 $this->template($template) |
28 or die ArgException->new(template => 'A template is required'); | 28 or die ArgException->new(template => 'A template is required'); |
29 | |
30 if (ref $args eq 'HASH') { | |
31 while(my ($key, $value) = each %$args) { | |
32 next if grep $_ eq $key, qw(context template); | |
33 $this->$key($value); | |
34 } | |
35 } | |
29 } | 36 } |
30 | 37 |
31 sub _PopulateMethods { | 38 sub _PopulateMethods { |
32 my ($this,@methods) = @_; | 39 my ($this,@methods) = @_; |
33 | 40 |