diff Lib/IMPL/Web/View/TTControl.pm @ 356:97131d500f16

TTView: added identifiers support
author cin
date Thu, 17 Oct 2013 17:48:50 +0400
parents feeb3bc4a818
children 833e663796c4
line wrap: on
line diff
--- a/Lib/IMPL/Web/View/TTControl.pm	Thu Oct 17 01:04:37 2013 +0400
+++ b/Lib/IMPL/Web/View/TTControl.pm	Thu Oct 17 17:48:50 2013 +0400
@@ -13,22 +13,10 @@
 	],
 	props => [
 		context => PROP_RO,
-		template => PROP_RO,
-		id => {
-	   		get => sub { shift->_stash->get('id') },
-	   		set => sub { shift->_stash->set('id',shift) }
-		}
+		template => PROP_RO
 	]
 };
 
-
-{
-    my $nextId = 1;
-    sub _GetNextId {
-        return '_' . $nextId++;
-    }
-}
-
 our $AUTOLOAD_REGEX = qr/^[a-z]/;
 
 sub CTOR {
@@ -40,6 +28,20 @@
     	or die ArgException->new(template => 'A template is required');
 }
 
+sub _PopulateMethods {
+	my ($this,@methods) = @_;
+	
+	$this->_stash->update({
+		map {
+			my $name = $_;
+			$name,
+			sub {
+				$this->$name(@_);
+			}
+		} @methods
+	});
+}
+
 sub _stash {
 	$_[0]->context->stash;
 }