# HG changeset patch # User wizard # Date 1270225157 -14400 # Node ID a5cb84374d40fe69713fa518cb5965e565d9c5da # Parent 9d24db321029d0112b8a0a9d81ccb1178ad3a31c TT::Control in work diff -r 9d24db321029 -r a5cb84374d40 Lib/IMPL/Web/TT/Control.pm --- /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