comparison Lib/IMPL/Web/View/TTLoader.pm @ 310:0a9d51cf6dfd

*TTView: refactoring, document supports custom classes, layouts are become controls
author sergey
date Fri, 19 Apr 2013 16:39:01 +0400
parents 5e4e7c8fbca1
children d3b5a67ad2e8
comparison
equal deleted inserted replaced
309:5e4e7c8fbca1 310:0a9d51cf6dfd
88 my $registry = TTRegistry->new($this, $ctx); 88 my $registry = TTRegistry->new($this, $ctx);
89 89
90 my $factory = TTFactory->new($tt->class || TTDocument, $tt, $ctx, $name, $registry); 90 my $factory = TTFactory->new($tt->class || TTDocument, $tt, $ctx, $name, $registry);
91 91
92 $vars->{registry} = $registry; 92 $vars->{registry} = $registry;
93 $vars->{layoutBase} = $this->layoutBase;
93 94
94 return $factory->new( $vars ); 95 return $factory->new( $vars );
95 } 96 }
96 97
97 98
111 } elsif (defined $error and $error == STATUS_ERROR) { 112 } elsif (defined $error and $error == STATUS_ERROR) {
112 die Exception->new("Failed to load a template", $name, $tt); 113 die Exception->new("Failed to load a template", $name, $tt);
113 } 114 }
114 115
115 return $tt; 116 return $tt;
116 }
117
118 sub layout {
119 my ($this,$name) = @_;
120
121 my $layout;
122
123 if ($this->layoutBase) {
124 $layout = $this->layoutBase . "/";
125 }
126
127 $layout .= $name;
128 return $this->template($layout);
129 } 117 }
130 118
131 sub _appendExt { 119 sub _appendExt {
132 my ($this,$name) = @_; 120 my ($this,$name) = @_;
133 121