annotate Lib/IMPL/Web/View/TTLoader.pm @ 285:546957c50a36

*IMPL::Web::Handler::TTView Reworked template selection mechanism *IMPL::Web::Application: refactoring -Removed obsolete IMPL::Text modules
author cin
date Mon, 18 Feb 2013 02:55:59 +0400
parents 6b6d4b2275a1
children 2d253e6e4a88
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',
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
11 TTDocument => 'IMPL::Web::View::TTDocument',
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
12 Exception => 'IMPL::Exception',
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
13 ArgumentException => '-IMPL::InvalidArgumentException',
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
14 KeyNotFoundException => '-IMPL::KeyNotFoundException'
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
15 },
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
16 base => [
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
17 'IMPL::Object' => undef,
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
18 'IMPL::Object::Serializable' => undef
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
19 ],
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
20 props => [
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
21 options => PROP_RO,
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
22 provider => PROP_RO,
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
23 context => PROP_RO,
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
24 ext => PROP_RO,
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
25 layoutBase => PROP_RO,
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
26 isInitialized => PROP_RO,
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
27 initializer => PROP_RO,
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
28 _globals => PROP_RW
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
29 ]
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
30 };
181
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
31
196
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
32 sub save {
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
33 my ($this,$context) = @_;
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
34
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
35 $context->AddVar($_, $this->$_()) for qw(options provider context ext layoutBase);
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
36 }
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
37
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
38 sub restore {
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
39 my ($class,$data,$surrogate) = @_;
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
40
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
41 my %params = @$data;
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
42
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
43 my $refOpts = delete $params{options};
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
44
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
45 if ($surrogate){
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
46 $surrogate->callCTOR($refOpts,%params);
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
47 } else {
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
48 $surrogate = $class->new($refOpts,%params);
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
49 }
206
c8fe3f84feba +IMPL::Web::Handlers::ViewSelector
sergey
parents: 205
diff changeset
50 return $surrogate;
196
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
51 }
a705e848dcc7 added IMPL::Config::Reference
cin
parents: 195
diff changeset
52
181
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
53 sub CTOR {
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
54 my ($this,$refOpts,%args) = @_;
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
55
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
56 $refOpts ||= {};
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
57
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
58 $this->ext($args{ext}) if $args{ext};
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
59 $this->initializer($args{initializer}) if $args{initializer};
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
60 $this->_globals(ref $args{globals} eq 'HASH' ? $args{globals} : {});
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
61
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
62 $this->options($refOpts);
195
7a920771fd8e IMPL::Web::View changed document layout handling, docs, examples
cin
parents: 194
diff changeset
63 $this->layoutBase($args{layoutBase}) if $args{layoutBase};
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
64
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
65 # to aviod cyclic references we need to do a copy of $refOpts
265
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
66 $refOpts->{LOAD_TEMPLATES} = $this->provider(Provider->new( { %$refOpts } ));
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
67
265
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
68 $this->context(Context->new($refOpts));
181
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
69 }
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
70
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
71 sub document {
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
72 my ($this,$name,$vars) = @_;
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
73
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
74 my $tt = $this->template($name);
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
75
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
76 $this->_init();
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
77
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
78 my $opts = { %{ $this->options } };
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
79
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
80 $opts->{STASH} = $this->context->stash->clone();
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
81 $opts->{LOAD_TEMPLATES} = $this->provider;
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
82
265
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
83 return TTDocument->new( $tt, $opts, $this, $vars );
181
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
84 }
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
85
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
86 sub template {
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
87 my ($this,$name) = @_;
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
88
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
89 $name =~ s/^\s+|\s+$//g;
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
90
265
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
91 die ArgumentException->new("A valid template name is required") unless length $name;
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
92
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
93 $name = $this->_appendExt($name);
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
94
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
95 my ($tt,$error) = $this->provider->fetch($name);
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
96
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
97 if (defined $error and $error == STATUS_DECLINED) {
285
546957c50a36 *IMPL::Web::Handler::TTView Reworked template selection mechanism
cin
parents: 265
diff changeset
98 die KeyNotFoundException->new($name);
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
99 } elsif (defined $error and $error == STATUS_ERROR) {
265
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
100 die Exception->new("Failed to load a template", $name, $tt);
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
101 }
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
102
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
103 return $tt;
181
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
104 }
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
105
195
7a920771fd8e IMPL::Web::View changed document layout handling, docs, examples
cin
parents: 194
diff changeset
106 sub layout {
7a920771fd8e IMPL::Web::View changed document layout handling, docs, examples
cin
parents: 194
diff changeset
107 my ($this,$name) = @_;
7a920771fd8e IMPL::Web::View changed document layout handling, docs, examples
cin
parents: 194
diff changeset
108
7a920771fd8e IMPL::Web::View changed document layout handling, docs, examples
cin
parents: 194
diff changeset
109 my $layout;
7a920771fd8e IMPL::Web::View changed document layout handling, docs, examples
cin
parents: 194
diff changeset
110
7a920771fd8e IMPL::Web::View changed document layout handling, docs, examples
cin
parents: 194
diff changeset
111 if ($this->layoutBase) {
7a920771fd8e IMPL::Web::View changed document layout handling, docs, examples
cin
parents: 194
diff changeset
112 $layout = $this->layoutBase . "/";
7a920771fd8e IMPL::Web::View changed document layout handling, docs, examples
cin
parents: 194
diff changeset
113 }
7a920771fd8e IMPL::Web::View changed document layout handling, docs, examples
cin
parents: 194
diff changeset
114
7a920771fd8e IMPL::Web::View changed document layout handling, docs, examples
cin
parents: 194
diff changeset
115 $layout .= $name;
7a920771fd8e IMPL::Web::View changed document layout handling, docs, examples
cin
parents: 194
diff changeset
116 return $this->template($layout);
7a920771fd8e IMPL::Web::View changed document layout handling, docs, examples
cin
parents: 194
diff changeset
117 }
7a920771fd8e IMPL::Web::View changed document layout handling, docs, examples
cin
parents: 194
diff changeset
118
181
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
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
148 1;
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
149
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
150 __END__
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
151
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
152 =pod
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
153
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
154 =head1 NAME
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
155
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
156 C<IMPL::Web::View::TTLoader> - предоставляет глобальный контекст для загрузки шаблонов
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
157
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
158 =head1 SYNOPSIS
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
159
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
160 =begin code
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
161
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
162 use IMPL::Web::View::TTLoader();
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
163
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
164 my $loader = new IMPL::Web::View::TTLoader(
194
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
165 {
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
166 INCLUDE_PATH => [
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
167 '/my/app/tt',
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
168 '/my/app/tt/lib'
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
169 ]
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
170 },
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
171 ext => '.tt',
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
172 initializer => 'shared/global'
4d0e1962161c Replaced tabs with spaces
cin
parents: 185
diff changeset
173
181
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
174 );
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
175
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
176 my $doc = $loader->document('index');
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
177
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
178 my $html = $doc->Render();
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
179
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
180 =end code
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
181
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
182 =head1 DESCRIPTION
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
183
265
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
184 Провайдер для загрузки шаблонов и документов. Имеет собственное пространство
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
185 имен, контекст выполнения шаблонов. Контект загрузчика инициализируется
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
186 шаблоном, в котором определяются глобальные переменные, которые будут доступны
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
187 в документах, однако их изменения будут локализованы.
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
188
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
189 Инициализация контекста провайдера происходит при первой загрузке любого
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
190 документа.
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
191
182
sergey
parents: 181
diff changeset
192 =head1 MEMBERS
sergey
parents: 181
diff changeset
193
265
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
194 =head2 C<CTOR($options,%args)>
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
195
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
196 =over
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
197
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
198 =item * C<$options>
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
199
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
200 Параметры контекста загрузчика, контексты документов и элементов управления
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
201 также унаследуют эти свойства. Напрямую передаются в конструктор
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
202 C<Template::Context>.
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
203
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
204 =item * C<%args>
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
205
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 =over
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
209
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
210 =item * C<ext>
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
211
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 =item * C<initializer>
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
216
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
217 Имя шаблона, который будет использован для инициализации контекста.
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
218
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
219 =item * C<globals>
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
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
223 =item * C<layoutBase>
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 C<layout> указанный в его C<META> блоке или конструкторе.
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
227 См. C<IMPL::View::TTDocument>.
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
228
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
229 =back
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
230
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
231 =back
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
232
182
sergey
parents: 181
diff changeset
233 =head2 C<document($docName)>
sergey
parents: 181
diff changeset
234
265
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
235 Загружает документ с именем C<$docName>. При необходимости к нему будет
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
236 добавлено расширение, указанное в свойстве C<ext>. Это единственно полезный
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
237 метод провайдера.
6b6d4b2275a1 improved documentation
cin
parents: 232
diff changeset
238
181
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
239 =cut
47dac58691ee New templating system, small fixes
sourcer
parents:
diff changeset
240