diff Lib/IMPL/Web/TT/Control.pm @ 194:4d0e1962161c

Replaced tabs with spaces IMPL::Web::View - fixed document model, new features (control classes, document constructor parameters)
author cin
date Tue, 10 Apr 2012 20:08:29 +0400
parents d1676be8afcc
children
line wrap: on
line diff
--- a/Lib/IMPL/Web/TT/Control.pm	Tue Apr 10 08:13:22 2012 +0400
+++ b/Lib/IMPL/Web/TT/Control.pm	Tue Apr 10 20:08:29 2012 +0400
@@ -9,37 +9,37 @@
 __PACKAGE__->PassThroughArgs;
 
 BEGIN {
-	public property controlClass => prop_all;
-	public property template => prop_all;
-	public property id => prop_all;
+    public property controlClass => prop_all;
+    public property template => prop_all;
+    public property id => prop_all;
 }
 
 my $nextId = 1;
 
 sub CTOR {
-	my ($this,%args) = @_;
-	
-	if ($this->document) {
-		# load a template
-		$this->template( $this->document->context->template($args{template})) if ($args{template} and not ref $args{template});
-	}
-	#$this->template($args{template}) if $args{template};
+    my ($this,%args) = @_;
+    
+    if ($this->document) {
+        # load a template
+        $this->template( $this->document->context->template($args{template})) if ($args{template} and not ref $args{template});
+    }
+    #$this->template($args{template}) if $args{template};
 
-	$this->id($this->nodeName . '-' . $nextId++);
-	$this->controlClass('Control') unless $this->controlClass;
+    $this->id($this->nodeName . '-' . $nextId++);
+    $this->controlClass('Control') unless $this->controlClass;
 }
 
 sub Render {
-	my ($this) = @_;
-	
-	if ($this->document) {
-		if ($this->template) {
-			return $this->document->context->include($this->template,{ this => $this }) ;
-		} elsif ($this->document->presenter) {
-			return $this->document->presenter->print($this);
-		} else {
-			return $this->toString().": ".$this->controlClass() . ": ".$this->path;
-		}
-	}
+    my ($this) = @_;
+    
+    if ($this->document) {
+        if ($this->template) {
+            return $this->document->context->include($this->template,{ this => $this }) ;
+        } elsif ($this->document->presenter) {
+            return $this->document->presenter->print($this);
+        } else {
+            return $this->toString().": ".$this->controlClass() . ": ".$this->path;
+        }
+    }
 }
 1;