annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
181
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
1 package IMPL::Web::View::TTLoader;
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
2 use strict;
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
3
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
4 use Template::Constants qw(:status);
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
5
265
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
6 use IMPL::Const qw(:prop);
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
7 use IMPL::declare {
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
8 require => {
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
9 Provider => 'Template::Provider',
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
10 Context => 'Template::Context',
309
cin
parents: 308
diff changeset
11 TTRegistry => 'IMPL::Web::View::TTRegistry',
308
sergey
parents: 289
diff changeset
12 TTFactory => 'IMPL::Web::View::TTFactory',
309
cin
parents: 308
diff changeset
13 TTDocument => '-IMPL::Web::View::TTDocument',
265
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
14 Exception => 'IMPL::Exception',
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
15 ArgumentException => '-IMPL::InvalidArgumentException',
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
16 KeyNotFoundException => '-IMPL::KeyNotFoundException'
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
17 },
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
18 base => [
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
19 'IMPL::Object' => undef,
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
20 'IMPL::Object::Serializable' => undef
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
21 ],
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
22 props => [
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
23 options => PROP_RO,
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
24 provider => PROP_RO,
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
25 context => PROP_RO,
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
26 ext => PROP_RO,
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
27 layoutBase => PROP_RO,
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
28 isInitialized => PROP_RO,
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
29 initializer => PROP_RO,
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
30 _globals => PROP_RW
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
31 ]
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
32 };
181
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
33
196
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
34 sub save {
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
35 my ($this,$context) = @_;
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
36
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
37 $context->AddVar($_, $this->$_()) for qw(options provider context ext layoutBase);
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
38 }
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
39
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
40 sub restore {
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
41 my ($class,$data,$surrogate) = @_;
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
42
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
43 my %params = @$data;
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
44
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
45 my $refOpts = delete $params{options};
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
46
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
47 if ($surrogate){
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
48 $surrogate->callCTOR($refOpts,%params);
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
49 } else {
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
50 $surrogate = $class->new($refOpts,%params);
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
51 }
206
c8fe3f84feba +IMPL::Web::Handlers::ViewSelector
sergey
parents: 205
diff changeset
52 return $surrogate;
196
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
53 }
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
54
181
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
55 sub CTOR {
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
56 my ($this,$refOpts,%args) = @_;
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
57
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
58 $refOpts ||= {};
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
59
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
60 $this->ext($args{ext}) if $args{ext};
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
61 $this->initializer($args{initializer}) if $args{initializer};
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
62 $this->_globals(ref $args{globals} eq 'HASH' ? $args{globals} : {});
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
63
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
64 $this->options($refOpts);
195
7a920771fd8e IMPL::Web::View changed document layout handling, docs, examples
cin
parents: 194
diff changeset
65 $this->layoutBase($args{layoutBase}) if $args{layoutBase};
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
66
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
67 # to aviod cyclic references we need to do a copy of $refOpts
265
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
68 $refOpts->{LOAD_TEMPLATES} = $this->provider(Provider->new( { %$refOpts } ));
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
69
265
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
70 $this->context(Context->new($refOpts));
181
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
71 }
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
72
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
73 sub document {
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
74 my ($this,$name,$vars) = @_;
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
75
309
cin
parents: 308
diff changeset
76 $vars ||= {};
308
sergey
parents: 289
diff changeset
77
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
78 my $tt = $this->template($name);
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
79
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
80 $this->_init();
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
81
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
82 my $opts = { %{ $this->options } };
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
83
287
2d253e6e4a88 *TTView refactoring
cin
parents: 285
diff changeset
84 $this->context->localise();
289
85572f512abc *TTView refactoring
cin
parents: 287
diff changeset
85 my $ctx = _clone_context($this->context);
287
2d253e6e4a88 *TTView refactoring
cin
parents: 285
diff changeset
86 $this->context->delocalise();
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
87
309
cin
parents: 308
diff changeset
88 my $registry = TTRegistry->new($this, $ctx);
cin
parents: 308
diff changeset
89
cin
parents: 308
diff changeset
90 my $factory = TTFactory->new($tt->class || TTDocument, $tt, $ctx, $name, $registry);
308
sergey
parents: 289
diff changeset
91
309
cin
parents: 308
diff changeset
92 $vars->{registry} = $registry;
310
0a9d51cf6dfd *TTView: refactoring, document supports custom classes, layouts are become controls
sergey
parents: 309
diff changeset
93 $vars->{layoutBase} = $this->layoutBase;
309
cin
parents: 308
diff changeset
94
cin
parents: 308
diff changeset
95 return $factory->new( $vars );
181
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
96 }
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
97
308
sergey
parents: 289
diff changeset
98
181
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
99 sub template {
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
100 my ($this,$name) = @_;
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
101
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
102 $name =~ s/^\s+|\s+$//g;
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
103
265
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
104 die ArgumentException->new("A valid template name is required") unless length $name;
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
105
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
106 $name = $this->_appendExt($name);
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
107
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
108 my ($tt,$error) = $this->provider->fetch($name);
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
109
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
110 if (defined $error and $error == STATUS_DECLINED) {
285
546957c50a36 *IMPL::Web::Handler::TTView Reworked template selection mechanism
cin
parents: 265
diff changeset
111 die KeyNotFoundException->new($name);
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
112 } elsif (defined $error and $error == STATUS_ERROR) {
265
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
113 die Exception->new("Failed to load a template", $name, $tt);
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
114 }
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
115
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
116 return $tt;
181
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
117 }
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
118
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
119 sub _appendExt {
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
120 my ($this,$name) = @_;
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
121
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
122 return $name unless $this->ext;
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
123
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
124 if (length $this->ext and substr( $name, -length($this->ext) ) eq $this->ext) {
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
125 return $name;
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
126 } else {
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
127 return $name . $this->ext;
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
128 }
181
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
129 }
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
130
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
131 sub _init {
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
132 my ($this) = @_;
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
133
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
134 if (!$this->isInitialized) {
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
135 my $initializer = $this->initializer || sub {};
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
136
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
137 eval {
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
138 $this->context->process($initializer,$this->_globals);
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
139 };
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
140 if (my $e = $@) {
265
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
141 die Exception->new("Failed to process an initializer", $this->initializer, $e);
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
142 }
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
143
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
144 $this->isInitialized(1);
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
145 }
181
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
146 }
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
147
289
85572f512abc *TTView refactoring
cin
parents: 287
diff changeset
148 sub _clone_context {
85572f512abc *TTView refactoring
cin
parents: 287
diff changeset
149 my $args = { %{shift || {}} };
85572f512abc *TTView refactoring
cin
parents: 287
diff changeset
150 delete $args->{CONFIG};
85572f512abc *TTView refactoring
cin
parents: 287
diff changeset
151
85572f512abc *TTView refactoring
cin
parents: 287
diff changeset
152 return Template::Context->new($args);
85572f512abc *TTView refactoring
cin
parents: 287
diff changeset
153 }
85572f512abc *TTView refactoring
cin
parents: 287
diff changeset
154
181
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
155 1;
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
156
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
157 __END__
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
158
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
159 =pod
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
160
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
161 =head1 NAME
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
162
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
163 C<IMPL::Web::View::TTLoader> - предоставляет глобальный контекст для загрузки шаблонов
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
164
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
165 =head1 SYNOPSIS
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
166
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
167 =begin code
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
168
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
169 use IMPL::Web::View::TTLoader();
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
170
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
171 my $loader = new IMPL::Web::View::TTLoader(
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
172 {
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
173 INCLUDE_PATH => [
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
174 '/my/app/tt',
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
175 '/my/app/tt/lib'
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
176 ]
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
177 },
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
178 ext => '.tt',
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
179 initializer => 'shared/global'
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
180
181
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
181 );
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
182
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
183 my $doc = $loader->document('index');
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
184
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
185 my $html = $doc->Render();
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
186
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
187 =end code
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
188
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
189 =head1 DESCRIPTION
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
190
265
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
191 Провайдер для загрузки шаблонов и документов. Имеет собственное пространство
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
192 имен, контекст выполнения шаблонов. Контект загрузчика инициализируется
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
193 шаблоном, в котором определяются глобальные переменные, которые будут доступны
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
194 в документах, однако их изменения будут локализованы.
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
195
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
196 Инициализация контекста провайдера происходит при первой загрузке любого
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
197 документа.
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
198
182
sergey
parents: 181
diff changeset
199 =head1 MEMBERS
sergey
parents: 181
diff changeset
200
265
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
201 =head2 C<CTOR($options,%args)>
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
202
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
203 =over
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
204
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
205 =item * C<$options>
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
206
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
207 Параметры контекста загрузчика, контексты документов и элементов управления
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
208 также унаследуют эти свойства. Напрямую передаются в конструктор
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
209 C<Template::Context>.
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
210
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
211 =item * C<%args>
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
212
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
213 Именованные параметы загрузчика.
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
214
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
215 =over
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
216
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
217 =item * C<ext>
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
218
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
219 Расширение, которое будет добавляться к именам шаблонов и документов (если оно
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
220 не будет указано явно).
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
221
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
222 =item * C<initializer>
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
223
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
224 Имя шаблона, который будет использован для инициализации контекста.
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
225
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
226 =item * C<globals>
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
227
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
228 Глобальные переменнын, которые будут переданы в контекст.
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
229
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
230 =item * C<layoutBase>
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
231
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
232 Путь к шаблонам для оформления документов. Каждый документ может задавать свой
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
233 C<layout> указанный в его C<META> блоке или конструкторе.
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
234 См. C<IMPL::View::TTDocument>.
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
235
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
236 =back
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
237
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
238 =back
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
239
182
sergey
parents: 181
diff changeset
240 =head2 C<document($docName)>
sergey
parents: 181
diff changeset
241
265
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
242 Загружает документ с именем C<$docName>. При необходимости к нему будет
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
243 добавлено расширение, указанное в свойстве C<ext>. Это единственно полезный
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
244 метод провайдера.
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
245
181
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
246 =cut
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
247