78
|
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; |