Mercurial > pub > Impl
comparison Lib/IMPL/Web/TT/Control.pm @ 78:a5cb84374d40
TT::Control in work
| author | wizard |
|---|---|
| date | Fri, 02 Apr 2010 20:19:17 +0400 |
| parents | |
| children | 0e72ad99eef7 |
comparison
equal
deleted
inserted
replaced
| 77:9d24db321029 | 78:a5cb84374d40 |
|---|---|
| 1 package IMPL::Web::TT::Control; | |
| 2 | |
| 3 use base qw(IMPL::DOM::Node); | |
| 4 | |
| 5 use IMPL::Class::Property; | |
| 6 | |
| 7 our %CTOR = ( | |
| 8 'IMPL::DOM::Node' => sub { | |
| 9 #TODO: Pass arguments | |
| 10 } | |
| 11 ); | |
| 12 | |
| 13 BEGIN { | |
| 14 public property template => prop_all; | |
| 15 } | |
| 16 | |
| 17 sub Render { | |
| 18 my ($this) = @_; | |
| 19 | |
| 20 if ($this->document) { | |
| 21 if ($this->template) { | |
| 22 return $this->document->context->include($this->template,{ this => $this }); | |
| 23 } elsif ($this->document->presenter) { | |
| 24 return $this->document->presenter->print($this); | |
| 25 } else { | |
| 26 return $this->toString(); | |
| 27 } | |
| 28 } | |
| 29 } | |
| 30 | |
| 31 1; |
