Mercurial > pub > Impl
comparison Lib/IMPL/Web/View/TTControl.pm @ 267:bbc0da7ef90e
*IMPL::Web::View refactoring
| author | cin |
|---|---|
| date | Thu, 17 Jan 2013 02:39:44 +0400 |
| parents | 6b6d4b2275a1 |
| children | 86ff93b34f2a |
comparison
equal
deleted
inserted
replaced
| 266:89179bb8c388 | 267:bbc0da7ef90e |
|---|---|
| 94 } else { | 94 } else { |
| 95 return $this->attributes->{$name} = shift; | 95 return $this->attributes->{$name} = shift; |
| 96 } | 96 } |
| 97 } | 97 } |
| 98 | 98 |
| 99 sub GetRenderBlock { | 99 sub GetMainBlock { |
| 100 $_[0]->template->blocks->{RENDER} || $_[0]->template; | 100 $_[0]->template->blocks->{RENDER} || $_[0]->template; |
| 101 } | 101 } |
| 102 | 102 |
| 103 sub Render { | 103 sub Render { |
| 104 my ($this,$args) = @_; | 104 my ($this,$args) = @_; |
| 105 | 105 |
| 106 $args = {} unless ref $args eq 'HASH'; | 106 $args = {} unless ref $args eq 'HASH'; |
| 107 | 107 |
| 108 if(my $body = $this->GetRenderBlock ) { | 108 if(my $body = $this->GetMainBlock ) { |
| 109 return $this->context->include( $body, { %$args, this => $this, template => $this->template } ); | 109 return $this->context->include( $body, { %$args, this => $this, template => $this->template } ); |
| 110 } else { | 110 } else { |
| 111 return ""; | 111 return ""; |
| 112 } | 112 } |
| 113 } | |
| 114 | |
| 115 sub RenderBlock { | |
| 116 my ($this,$block, $args) = @_; | |
| 117 | |
| 118 $args = {} unless ref $args eq 'HASH'; | |
| 119 | |
| 120 return $this->context->include( $block, { %$args, this => $this, template => $this->template } ); | |
| 113 } | 121 } |
| 114 | 122 |
| 115 sub AUTOLOAD { | 123 sub AUTOLOAD { |
| 116 our $AUTOLOAD; | 124 our $AUTOLOAD; |
| 117 | 125 |
