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