44class Template%a% extends Latte \Template
55{
66 public $ blocks = [
7- '_snippet ' => ['blockSnippet ' , 'html ' ],
8- 'block1 ' => ['blockBlock1 ' , 'html ' ],
9- '_outer ' => ['blockOuter ' , 'html ' ],
10- 'block2 ' => ['blockBlock2 ' , 'html ' ],
7+ 'block1 ' => 'blockBlock1 ' ,
8+ '_snippet ' => 'blockSnippet ' ,
9+ '_outer ' => 'blockOuter ' ,
10+ 'block2 ' => 'blockBlock2 ' ,
11+ ];
12+
13+ public $ blockTypes = [
14+ 'block1 ' => 'html ' ,
15+ '_snippet ' => 'html ' ,
16+ '_outer ' => 'html ' ,
17+ 'block2 ' => 'html ' ,
1118 ];
1219
1320
1421 function render ()
1522 {
1623%A%
1724 // main template
18- if ($ this ->tryRenderParent (get_defined_vars ())) return;
19- call_user_func (reset ($ this ->blockQueue ['_snippet ' ]), $ this ->params );
25+ call_user_func (reset ($ this ->blockQueue ['block1 ' ]), get_defined_vars ());
2026 ?>
2127
2228
@@ -25,21 +31,23 @@ class Template%a% extends Latte\Template
2531 }
2632
2733
28- function blockSnippet ($ _args )
34+ function blockBlock1 ($ _args )
2935 {
3036 extract ($ _args );
31- $ _control ->redrawControl ('snippet ' , FALSE );
32-
37+ ?> <div<?php echo ' id=" ' . $ _control ->getSnippetId ('snippet ' ) . '" ' ?> >
38+ <?php call_user_func (reset ($ this ->blockQueue ['_snippet ' ]), $ this ->params ) ?>
39+ </div>
40+ <?php
3341
3442 }
3543
3644
37- function blockBlock1 ($ _args )
45+ function blockSnippet ($ _args )
3846 {
3947 extract ($ _args );
40- ?> <div <?php echo ' id=" ' . $ _control ->getSnippetId ('snippet ' ) . ' " ' ?> >
41- static
42- </div>
48+ $ _control ->redrawControl ('snippet ' , FALSE );
49+
50+ ?> static
4351<?php
4452 }
4553
@@ -51,6 +59,9 @@ class Template%a% extends Latte\Template
5159
5260 ?>
5361begin
62+ <?php
63+ call_user_func (reset ($ this ->blockQueue ['block2 ' ]), get_defined_vars ());
64+ ?>
5465end
5566<?php
5667 if (isset ($ this ->local ->dynSnippets )) return $ this ->local ->dynSnippets ;
6273 {
6374 extract ($ _args );
6475 ?> <div<?php echo ' id=" ' . ($ this ->local ->dynSnippetId = $ _control ->getSnippetId ("inner- $ id " )) . '" ' ?> >
65- dynamic
66- </div>
76+ <?php ob_start () ?> dynamic
77+ <?php $ this -> local -> dynSnippets [ $ this -> local -> dynSnippetId ] = ob_get_flush () ?> < /div>
6778<?php
79+
6880 }
6981
7082}
0 commit comments