Mercurial > pub > Impl
annotate Lib/IMPL/Web/View/TTDocument.pm @ 241:f48a1a9f4fa2
+Added ViewResult to allow implementation of the view environment.
*TTDocuments now storing creation parameters
*TTControls automatically propagating layout and title meta to their attributes
+Added UnauthorizaedException web exception
*minor fixes
author | sergey |
---|---|
date | Thu, 18 Oct 2012 04:49:55 +0400 |
parents | b8c724f6de36 |
children | 7c517134c42f |
rev | line source |
---|---|
181 | 1 package IMPL::Web::View::TTDocument; |
2 use strict; | |
3 | |
236 | 4 use Scalar::Util qw(weaken); |
5 use IMPL::Const qw(:prop); | |
241
f48a1a9f4fa2
+Added ViewResult to allow implementation of the view environment.
sergey
parents:
238
diff
changeset
|
6 use IMPL::lang qw(:hash); |
181 | 7 |
236 | 8 use IMPL::declare { |
9 require => { | |
10 TTFactory => 'IMPL::Web::View::TTFactory', | |
11 TTControl => 'IMPL::Web::View::TTControl', | |
12 Loader => 'IMPL::Code::Loader' | |
13 }, | |
14 base => [ | |
15 'IMPL::Web::View::TTControl' => sub { | |
16 my ($template,$contextOpts) = @_; | |
17 'document', | |
238 | 18 $template, # template |
19 Template::Context->new($contextOpts) # context | |
236 | 20 } |
21 ], | |
22 props => [ | |
23 layout => PROP_RW, | |
24 opts => PROP_RO, | |
25 loader => PROP_RW, | |
26 controls => PROP_RO, | |
241
f48a1a9f4fa2
+Added ViewResult to allow implementation of the view environment.
sergey
parents:
238
diff
changeset
|
27 creationArgs => PROP_RO, |
236 | 28 |
29 # store the stash separately to make require() method to work correctly | |
30 # even when a stash of the context is modified during the processing | |
31 stash => PROP_RO | |
32 ] | |
33 }; | |
181 | 34 |
35 BEGIN { | |
236 | 36 |
181 | 37 } |
38 | |
39 sub CTOR { | |
194 | 40 my ($this,$template,$refOpts,$loader,$vars) = @_; |
41 | |
42 $this->controls({}); | |
43 $this->loader($loader) if $loader; | |
44 | |
45 $this->layout( $template->layout ) unless $this->layout; | |
46 | |
47 $this->opts($refOpts); | |
48 $this->stash($this->context->stash); | |
241
f48a1a9f4fa2
+Added ViewResult to allow implementation of the view environment.
sergey
parents:
238
diff
changeset
|
49 $this->creationArgs($vars); |
194 | 50 |
51 my $self = $this; | |
52 weaken($self); | |
53 | |
241
f48a1a9f4fa2
+Added ViewResult to allow implementation of the view environment.
sergey
parents:
238
diff
changeset
|
54 $this->templateVars(require => sub { |
194 | 55 my $doc = $self; |
56 die new IMPL::Exception("A document is destroyed or invalid") unless $doc; | |
236 | 57 $doc->RequireControl(@_); |
194 | 58 }); |
59 | |
241
f48a1a9f4fa2
+Added ViewResult to allow implementation of the view environment.
sergey
parents:
238
diff
changeset
|
60 $this->templateVars(context => $vars); |
f48a1a9f4fa2
+Added ViewResult to allow implementation of the view environment.
sergey
parents:
238
diff
changeset
|
61 |
f48a1a9f4fa2
+Added ViewResult to allow implementation of the view environment.
sergey
parents:
238
diff
changeset
|
62 $this->templateVars(document => sub { $self } ); |
194 | 63 $this->InitInstance($vars); |
181 | 64 } |
65 | |
189 | 66 sub templateVars { |
194 | 67 my $this = shift; |
68 my $name = shift; | |
69 | |
70 if (@_) { | |
71 return $this->stash->set($name, shift); | |
72 } else { | |
73 return $this->stash->get($name); | |
74 } | |
189 | 75 } |
76 | |
236 | 77 sub RequireControl { |
194 | 78 my ($this, $control, $nodeProps) = @_; |
79 | |
80 $nodeProps ||= {}; | |
81 $nodeProps->{document} = $this; | |
82 | |
83 if (my $factory = $this->controls->{$control}) { | |
84 return $factory; | |
85 } else { | |
86 | |
87 my $path = $control; | |
88 if ( my $template = $this->loader->template($path) ) { | |
89 my $opts = { %{$this->opts} }; | |
189 | 90 |
194 | 91 # avoid propagation of local variables |
92 $opts->{STASH} = $this->stash->clone(); | |
188 | 93 |
194 | 94 my $ctx = new Template::Context($opts); |
95 | |
96 $factory = new IMPL::Web::View::TTFactory( | |
97 $template->class || typeof IMPL::Web::View::TTControl, | |
98 $template, | |
99 $ctx, | |
100 $opts | |
101 ); | |
102 | |
236 | 103 if ($template->class) { |
104 Loader->safe->Require($template->class); | |
105 } | |
106 | |
194 | 107 my @parts = split(/\/+/,$control); |
108 | |
109 $this->controls->{$control} = $factory; | |
110 | |
111 return $factory; | |
188 | 112 |
194 | 113 } else { |
114 die new IMPL::KeyNotFoundException($control); | |
115 } | |
116 } | |
181 | 117 } |
118 | |
119 sub Render { | |
194 | 120 my ($this,$args) = @_; |
121 | |
241
f48a1a9f4fa2
+Added ViewResult to allow implementation of the view environment.
sergey
parents:
238
diff
changeset
|
122 $args ||= {}; |
f48a1a9f4fa2
+Added ViewResult to allow implementation of the view environment.
sergey
parents:
238
diff
changeset
|
123 |
f48a1a9f4fa2
+Added ViewResult to allow implementation of the view environment.
sergey
parents:
238
diff
changeset
|
124 my $newArgs = hashMerge($this->creationArgs, $args); |
194 | 125 |
126 if ($this->layout) { | |
241
f48a1a9f4fa2
+Added ViewResult to allow implementation of the view environment.
sergey
parents:
238
diff
changeset
|
127 return $this->context->include( |
195
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
128 $this->loader->layout($this->layout), |
194 | 129 { |
241
f48a1a9f4fa2
+Added ViewResult to allow implementation of the view environment.
sergey
parents:
238
diff
changeset
|
130 %{$newArgs}, |
f48a1a9f4fa2
+Added ViewResult to allow implementation of the view environment.
sergey
parents:
238
diff
changeset
|
131 content => sub { $this->RenderContent($newArgs); }, |
194 | 132 this => $this, |
133 template => $this->template | |
134 } | |
135 ); | |
136 } else { | |
241
f48a1a9f4fa2
+Added ViewResult to allow implementation of the view environment.
sergey
parents:
238
diff
changeset
|
137 return $this->RenderContent($newArgs); |
194 | 138 } |
181 | 139 } |
140 | |
190
cd1ff7029a63
IMLP::Web::View refactored, added new method 'require' which is available inside templates. Changed document rendering.
cin
parents:
189
diff
changeset
|
141 sub RenderContent { |
194 | 142 my $this = shift; |
143 return $this->SUPER::Render(@_); | |
190
cd1ff7029a63
IMLP::Web::View refactored, added new method 'require' which is available inside templates. Changed document rendering.
cin
parents:
189
diff
changeset
|
144 } |
cd1ff7029a63
IMLP::Web::View refactored, added new method 'require' which is available inside templates. Changed document rendering.
cin
parents:
189
diff
changeset
|
145 |
181 | 146 1; |
147 | |
148 __END__ | |
149 | |
150 =pod | |
151 | |
152 =head1 NAME | |
153 | |
154 C<IMPL::Web::View::TTDocument> - документ для построения HTML страницы на основе шаблонов TT. | |
155 | |
156 =head1 SYNOPSIS | |
157 | |
158 =begin code | |
159 | |
160 use IMPL::Web::View::TTDocument(); | |
161 | |
162 my $doc = new IMPL::Wbe::View::TTDocument($template,$ttOptions); | |
163 | |
164 return $doc->Render(); | |
165 | |
166 =end code | |
167 | |
168 Однако, более предпочтительный способ использовать C<IMPL::Web::View::TTLoader>. | |
169 | |
170 =head1 DESCRIPTION | |
171 | |
172 Документ для представления данных. Документы представляют собой иерархически организованные данные, | |
173 элементами данного документа являются данные для отображения, такие как | |
174 | |
175 =over | |
176 | |
177 =item * Объекты из БД | |
178 | |
179 =item * Навигационные цепочки | |
180 | |
181 =item * Меню и т.п. | |
182 | |
183 =back | |
184 | |
185 Скприт шаблона формирует структуру документа, затем сформированная структура форматируется в готовый документ. | |
192 | 186 Процесс форматирования объектной модели в готовый документ может быть выполнена как вручную, так и при помощи |
189 | 187 вспомогательного шаблона - обертки. Если у шаблона документа указан C<layout> в метаданных, то он будет |
181 | 188 использован как шаблон для форматирования объектной модели, вывод самого шаблона будет проигнорирован. Если |
189 обертка не задана, то результатом будет вывод самого скрипта шаблона. | |
190 | |
195
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
191 Использование объектной модели документа позволяет решить задачи по созданию контейнеров, |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
192 у которых может быть сложное содежимое. Примером таких элементов могут быть формы, |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
193 внутри форм элементы управления также могут группироваться. |
192 | 194 |
193 | 195 =head2 Элементы управления (компоненты) |
196 | |
197 Документ состоит из узлов, часть которых наследуется от C<IMPL::Web::View::TTControl>, такие узлы называются | |
198 элементами управления. Каждый элемент управления имеет собственный контекст, который наследуется от контекста | |
199 документа. | |
200 | |
201 =head2 Фабрика элементов управления | |
202 | |
203 Для создания элементов управления используются фабрики. Каждый элемен управления имеет свой шаблон для | |
204 форматиорвания содержимого, фабрика связывает шаблон и класс элемента управления, для чего при загрузке | |
205 шаблона используется свойство C<type> из метаданных. Фабрика загружается в документ при том только один | |
206 раз, повторные загрузки фабрики возвращают уже загруженную. Для загрузки фабрики используется метод | |
195
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
207 C<require()> с указанием элемента управления. |
190
cd1ff7029a63
IMLP::Web::View refactored, added new method 'require' which is available inside templates. Changed document rendering.
cin
parents:
189
diff
changeset
|
208 |
185 | 209 =head2 Порядок обработки документа |
210 | |
195
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
211 Построение представления данных состоит из двух этапов |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
212 |
185 | 213 =over |
214 | |
195
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
215 =item 1 Создание объектной модели документа. На данном этапе создаются все элементы управления. |
185 | 216 |
195
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
217 =item 1 Преобразование объектной модели в конечнное представление. На данном этапе происходит |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
218 форматирование документа. |
185 | 219 |
220 =back | |
181 | 221 |
195
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
222 |
181 | 223 =head2 Загрузка элемента управления |
224 | |
225 =over | |
226 | |
194 | 227 =item 1 C<TInput = require('my/org/input')> |
181 | 228 |
195
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
229 =item 1 Загружается шаблон C<my/org/input.tt> |
181 | 230 |
195
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
231 =item 1 Создается фабрика элементов управления с собственным контекстом, унаследованным от контекст документа. |
181 | 232 |
195
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
233 =item 1 При первом создании элемента управления фабрика инициализируется выполнением блока C<INIT>. |
181 | 234 |
235 =back | |
236 | |
237 =head2 Создание элемента управления | |
238 | |
239 =over | |
240 | |
194 | 241 =item 1 C<< TInput.new('login') >> |
181 | 242 |
243 =item 1 Создается новый дочерний контекст к контексту фабрики | |
244 | |
245 =item 1 Создается экземпляр элемента управления | |
246 | |
195
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
247 =item 1 Выполняется блок конструктора C<CTOR> в контексте элемента управления, параметр C<this> имеет значение |
181 | 248 нового экземпляра элемента управления |
249 | |
250 =back | |
251 | |
252 =head1 MEMBERS | |
253 | |
254 =over | |
255 | |
195
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
256 =item C<CTOR($template, $contextOpts, $loader[, $vars])> |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
257 |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
258 Создает экземпляр документа с указанным шаблоном и параметрами. |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
259 |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
260 =over |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
261 |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
262 =item C<$template> |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
263 |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
264 C<Template::Document> шаблон документа. |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
265 |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
266 =item C<$contextOpts> |
181 | 267 |
195
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
268 C<HASH> Параметры контекста C<Template::Context> для документа. Эти параметры будут сохранены |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
269 в свойстве C<opts>, а также на их основе будет создан контекст текщего документа. Как правило |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
270 эти параметы задаются загрузчиком документа C<IMPL::Web::View::TTLoader>, таким образом, что |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
271 C<Template::Stash> создаваемого контекста наследует переменные из контекста загрузчика. |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
272 |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
273 =item C<$loader> |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
274 |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
275 C<IMPL::Web::View::TTLoader> загрузчик, который будет использоваться для загрузки элементов управления, |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
276 а также для получения обертки, заданной в свойстве документа C<layout>. |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
277 |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
278 =item C<$vars> |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
279 |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
280 C<HASH> Необязательный параметр. переменные которые будут переданы в блок конструктора C<INIT>. |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
281 Как правило они используются для передачи данных для построения документа |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
282 |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
283 =back |
181 | 284 |
285 =back | |
286 | |
195
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
287 =over |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
288 |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
289 =item C<templateVars($name[,$newValue])> |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
290 |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
291 Получает или задает переменную для шаблона документа. Имя переменнной может быть составным, |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
292 например C<'my.var.name'>, см. C<Template::Stash::set()>. |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
293 |
236 | 294 =item C<RequireControl($controlName)> |
195
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
295 |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
296 Загружает фабрику элемента управления, если она уже была загружена, возвращает на нее ссылку. |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
297 При загрузки фабрики для нее создается собственный контекст на основе параметров из свойства |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
298 C<opts> и ее пространство имен наследуется от пространства имен документа из свойства C<stash>. |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
299 |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
300 =item C<Render($vars)> |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
301 |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
302 Выполняет блок C<renderBlock> документа для получения конечного представления, C<$vars> |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
303 содержит переменные для блока. |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
304 |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
305 =item C<RenderContent($vars)> |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
306 |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
307 Выполняет шаблон документа для получения представления содержимого, в отличии от |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
308 метода C<Render> не использует обертку указанную в свойстве C<layout>, если обертка |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
309 не указана, то эти методы идентичны. |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
310 |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
311 =item C<[get,set]layout> |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
312 |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
313 Обертка, которая будет использована для построения представления документа. В обертке |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
314 будет доступна специальная переменная C<content>, при обращении к которой будет B<выполнен> |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
315 метод C<RenderContent()> и возвращен результат его работы. Для получения шаблона обертки |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
316 используется загрузчик из свойства C<loader>. |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
317 |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
318 =item C<[get]opts> |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
319 |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
320 Параметры контекста, используются для создания контекстов фабрик элементов управления. |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
321 |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
322 =item C<[get]loader> |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
323 |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
324 Загрузчик, используется для загрузки шаблонов фабрик элементов управления и обертки. |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
325 |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
326 =item C<[get]controls> |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
327 |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
328 C<HASH> Коллекция загруженных фабрик элементов управления, ключем является |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
329 квалифицированное имя элемента управления. |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
330 |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
331 =item C<[get]stash> |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
332 |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
333 C<Template::Stash> Пространство имен документа, оно используется как родительское |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
334 для пространств имен загружаемых фабрик элементов управления. |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
335 |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
336 =back |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
337 |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
338 =head1 TEMPLATES |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
339 |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
340 =begin text |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
341 |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
342 [%META layout='default'%] |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
343 [% BLOCK CTOR; |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
344 section('top','TOP'); |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
345 section('bottom','BOTTOM'); |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
346 section('client','CLIENT'); |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
347 END %] |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
348 [% BLOCK TOP; |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
349 TMenu = require('my/org/Menu'); |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
350 append(TMenu.new()); |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
351 END %] |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
352 |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
353 =end |
7a920771fd8e
IMPL::Web::View changed document layout handling, docs, examples
cin
parents:
194
diff
changeset
|
354 |
181 | 355 =cut |