comparison Lib/IMPL/Web/View/TTControl.pm @ 301:aeeb57a12046

*IMPL::Web::View: templates inheritance support
author cin
date Mon, 25 Mar 2013 02:04:18 +0400
parents bf3af33b9003
children 673581380e79
comparison
equal deleted inserted replaced
300:bf3af33b9003 301:aeeb57a12046
40 $this->template( $template ) or die new IMPL::ArgumentException("A template is required"); 40 $this->template( $template ) or die new IMPL::ArgumentException("A template is required");
41 $this->context( $context ) or die new IMPL::ArgumentException("A context is required"); 41 $this->context( $context ) or die new IMPL::ArgumentException("A context is required");
42 42
43 $this->attributes({}); 43 $this->attributes({});
44 44
45 if(reftype($attrs) eq 'HASH') { 45 if(ref($attrs) eq 'HASH') {
46 while (my($key,$value) = each %$attrs) { 46 while (my($key,$value) = each %$attrs) {
47 $this->SetAttribute($key,$value); 47 $this->SetAttribute($key,$value);
48 } 48 }
49 } 49 }
50 50
78 my ($this,$args) = @_; 78 my ($this,$args) = @_;
79 79
80 $args = {} unless ref $args eq 'HASH'; 80 $args = {} unless ref $args eq 'HASH';
81 81
82 return $this->context->include( 82 return $this->context->include(
83 $this->template, 83 $this->template->block,
84 { 84 {
85 %$args, 85 %$args,
86 this => $this, 86 this => $this,
87 template => $this->template 87 template => $this->template
88 } 88 }