diff 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
line wrap: on
line diff
--- a/Lib/IMPL/Web/View/TTControl.pm	Mon Nov 18 01:25:35 2013 +0400
+++ b/Lib/IMPL/Web/View/TTControl.pm	Mon Nov 25 02:19:31 2013 +0400
@@ -20,12 +20,19 @@
 our $AUTOLOAD_REGEX = qr/^[a-z]/;
 
 sub CTOR {
-    my ($this,$context,$template) = @_;
+    my ($this,$context,$template,$args) = @_;
     
     $this->context($context)
     	or die ArgException->new(context => 'A context is required');
     $this->template($template)
     	or die ArgException->new(template => 'A template is required');
+    	
+    if (ref $args eq 'HASH') {
+    	while(my ($key, $value) = each %$args) {
+    		next if grep $_ eq $key, qw(context template);
+    		$this->$key($value);
+    	}
+    }
 }
 
 sub _PopulateMethods {