changeset 78:a5cb84374d40

TT::Control in work
author wizard
date Fri, 02 Apr 2010 20:19:17 +0400
parents 9d24db321029
children 2d1c3f713280
files Lib/IMPL/Web/TT/Control.pm
diffstat 1 files changed, 31 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Lib/IMPL/Web/TT/Control.pm	Fri Apr 02 20:19:17 2010 +0400
@@ -0,0 +1,31 @@
+package IMPL::Web::TT::Control;
+
+use base qw(IMPL::DOM::Node);
+
+use IMPL::Class::Property;
+
+our %CTOR = (
+	'IMPL::DOM::Node' => sub {
+		#TODO: Pass arguments
+	}
+);
+
+BEGIN {
+	public property template => prop_all;
+}
+
+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();
+		}
+	}
+}
+
+1;
\ No newline at end of file