Mercurial > pub > Impl
comparison Lib/IMPL/Web/View/TTControl.pm @ 302:673581380e79
Added templates provider functionality to controls
minor fixes
| author | cin |
|---|---|
| date | Mon, 01 Apr 2013 00:41:48 +0400 |
| parents | aeeb57a12046 |
| children | 2da2564f115d |
comparison
equal
deleted
inserted
replaced
| 301:aeeb57a12046 | 302:673581380e79 |
|---|---|
| 87 template => $this->template | 87 template => $this->template |
| 88 } | 88 } |
| 89 ); | 89 ); |
| 90 } | 90 } |
| 91 | 91 |
| 92 sub GetTemplate { | |
| 93 my ($this,$name) = @_; | |
| 94 | |
| 95 return eval { $this->context->template($name) }; | |
| 96 } | |
| 97 | |
| 98 sub Include { | |
| 99 my ($this,$template, $args) = @_; | |
| 100 | |
| 101 my $tpl = $this->GetTemplate($template) | |
| 102 or die OperationException->new("The specified template isn't found", $template); | |
| 103 | |
| 104 return $this->context->include( | |
| 105 $tpl, | |
| 106 $args | |
| 107 ); | |
| 108 } | |
| 109 | |
| 92 sub AUTOLOAD { | 110 sub AUTOLOAD { |
| 93 our $AUTOLOAD; | 111 our $AUTOLOAD; |
| 94 | 112 |
| 95 my $method = ($AUTOLOAD =~ m/(\w+)$/)[0]; | 113 my $method = ($AUTOLOAD =~ m/(\w+)$/)[0]; |
| 96 | 114 |
