241:
242: if (!$block) {
243: $hint = $layer && ($t = Latte\Helpers::getSuggestion($this->getBlockNames($layer), $name))
244: ? ", did you mean '$t'?"
245: : '.';
246: $name = $layer ? "$layer $name" : $name;
247: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
248: }
249:
250: $this->filter(
251: fn() => reset($block->functions)($params),
252: $mod,
253: $block->contentType,
254: "block $name",
255: );
300: $block->functions = array_merge($block->functions, $functions);
301: }
302:
303:
304: private function filter(callable $function, string|\Closure|null $mod, string $contentType, string $name): void
308: {
309: if ($mod === null || $mod === $contentType) {
310: $function();
311:
312: } elseif ($mod instanceof \Closure) {
313: echo $mod($this->capture($function), $contentType);
314:
240: : ($this->blocks[self::LayerLocal][$name] ?? $this->blocks[self::LayerTop][$name] ?? null);
241:
242: if (!$block) {
243: $hint = $layer && ($t = Latte\Helpers::getSuggestion($this->getBlockNames($layer), $name))
244: ? ", did you mean '$t'?"
245: : '.';
246: $name = $layer ? "$layer $name" : $name;
247: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
248: }
249:
250: $this->filter(
251: fn() => reset($block->functions)($params),
252: $mod,
253: $block->contentType,
254: "block $name",
| $function |
|
| $mod | null
|
| $contentType | 'html'
|
| $name | 'block productSnippet'
|
207: if ($ʟ_tmp instanceof Nette\Application\UI\Renderable) $ʟ_tmp->redrawControl(null, false);
208: $ʟ_tmp->render() ;
209:
210: echo ' </ul>
211: </div>
212: </section>
213:
214: <section class="productDetail"';
215: echo ' id="', htmlspecialchars($this->global->snippetDriver->getHtmlId('productSnippet')), '"';
216: echo '>';
217: $this->renderBlock('productSnippet', [], null, 'snippet') /* line 63 */;
218: echo '</section>
219:
220: <script>
221: // AUTOSUBMIT & RESET RADIO
53:
54: {block content}
55: <section class="breadcrumb">
56: <div class="container">
57: <ul class="uk-breadcrumb">
58: {control breadcrumbs}
59: </ul>
60: </div>
61: </section>
62:
63: <section class="productDetail" n:snippet="productSnippet">
64: {var $productImages = $record->allEshopProductImages->where(['langActive' => true, 'langLanguage.shortcut' => $locale])->order('rank')}
65: {ifset $currentVariant}
66: {var $variantImages = $currentVariant->allEshopProductVariantImages->where(['langActive' => true, 'langLanguage.shortcut' => $locale])->order('rank')}
67: {/ifset}
| $name | 'productSnippet'
|
| $params | array (0)
|
| $mod | null
|
| $layer | 'snippet'
|
241:
242: if (!$block) {
243: $hint = $layer && ($t = Latte\Helpers::getSuggestion($this->getBlockNames($layer), $name))
244: ? ", did you mean '$t'?"
245: : '.';
246: $name = $layer ? "$layer $name" : $name;
247: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
248: }
249:
250: $this->filter(
251: fn() => reset($block->functions)($params),
252: $mod,
253: $block->contentType,
254: "block $name",
255: );
300: $block->functions = array_merge($block->functions, $functions);
301: }
302:
303:
304: private function filter(callable $function, string|\Closure|null $mod, string $contentType, string $name): void
308: {
309: if ($mod === null || $mod === $contentType) {
310: $function();
311:
312: } elseif ($mod instanceof \Closure) {
313: echo $mod($this->capture($function), $contentType);
314:
240: : ($this->blocks[self::LayerLocal][$name] ?? $this->blocks[self::LayerTop][$name] ?? null);
241:
242: if (!$block) {
243: $hint = $layer && ($t = Latte\Helpers::getSuggestion($this->getBlockNames($layer), $name))
244: ? ", did you mean '$t'?"
245: : '.';
246: $name = $layer ? "$layer $name" : $name;
247: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
248: }
249:
250: $this->filter(
251: fn() => reset($block->functions)($params),
252: $mod,
253: $block->contentType,
254: "block $name",
| $function |
|
| $mod | 'html'
|
| $contentType | 'html'
|
| $name | 'block content'
|
294:
295:
296: public function blockBodyStructure(array $ʟ_args): void
298: {
299: extract($this->params);
300: extract($ʟ_args);
301: unset($ʟ_args);
302:
303: $this->createTemplate('@header.latte', $this->params, 'include')->renderToContentType('html') ;
304: $this->renderBlock('content', [], 'html') /* line 72 */;
305: $this->createTemplate('@footer.latte', $this->params, 'include')->renderToContentType('html') ;
306: }
307: }
62:
63: {block canonical}
64: {control canonical}
65: {/block}
66: </head>
67: <body n:class="$bodyClass ? $bodyClass">
68: {control scripts-body}
69:
70: {block bodyStructure}
71: {include file '@header.latte'}
72: {include block content}
73: {include file '@footer.latte'}
74: {/block}
75:
76: {control flashMessage}
| $name | 'content'
|
| $params | array (0)
|
| $mod | 'html'
|
241:
242: if (!$block) {
243: $hint = $layer && ($t = Latte\Helpers::getSuggestion($this->getBlockNames($layer), $name))
244: ? ", did you mean '$t'?"
245: : '.';
246: $name = $layer ? "$layer $name" : $name;
247: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
248: }
249:
250: $this->filter(
251: fn() => reset($block->functions)($params),
252: $mod,
253: $block->contentType,
254: "block $name",
255: );
300: $block->functions = array_merge($block->functions, $functions);
301: }
302:
303:
304: private function filter(callable $function, string|\Closure|null $mod, string $contentType, string $name): void
308: {
309: if ($mod === null || $mod === $contentType) {
310: $function();
311:
312: } elseif ($mod instanceof \Closure) {
313: echo $mod($this->capture($function), $contentType);
314:
240: : ($this->blocks[self::LayerLocal][$name] ?? $this->blocks[self::LayerTop][$name] ?? null);
241:
242: if (!$block) {
243: $hint = $layer && ($t = Latte\Helpers::getSuggestion($this->getBlockNames($layer), $name))
244: ? ", did you mean '$t'?"
245: : '.';
246: $name = $layer ? "$layer $name" : $name;
247: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
248: }
249:
250: $this->filter(
251: fn() => reset($block->functions)($params),
252: $mod,
253: $block->contentType,
254: "block $name",
| $function |
|
| $mod | null
|
| $contentType | 'html'
|
| $name | 'block bodyStructure'
|
91: echo ' </head>
92: <body';
93: echo ($ʟ_tmp = array_filter([$bodyClass ? $bodyClass : null])) ? ' class="' . LR\Filters::escapeHtmlAttr(implode(" ", array_unique($ʟ_tmp))) . '"' : "" ;
94: echo '>
95: ';
96: $ʟ_tmp = $this->global->uiControl->getComponent('scripts-body');
97: if ($ʟ_tmp instanceof Nette\Application\UI\Renderable) $ʟ_tmp->redrawControl(null, false);
98: $ʟ_tmp->render() ;
99:
100: echo "\n";
101: $this->renderBlock('bodyStructure', get_defined_vars()) /* line 70 */;
102: echo "\n";
103: $ʟ_tmp = $this->global->uiControl->getComponent('flashMessage');
104: if ($ʟ_tmp instanceof Nette\Application\UI\Renderable) $ʟ_tmp->redrawControl(null, false);
105: $ʟ_tmp->render() ;
60: </title>
61: {/block}
62:
63: {block canonical}
64: {control canonical}
65: {/block}
66: </head>
67: <body n:class="$bodyClass ? $bodyClass">
68: {control scripts-body}
69:
70: {block bodyStructure}
71: {include file '@header.latte'}
72: {include block content}
73: {include file '@footer.latte'}
74: {/block}
| $name | 'bodyStructure'
|
| $params |
|
148: }
149:
150: } elseif ($this->parentName) { $this->params = $params;
152: $this->createTemplate($this->parentName, $params, 'extends')->render($block);
153:
154: } elseif ($block !== null) { $this->renderBlock($block, $this->params);
156:
157: } else {
158: $this->main($params);
159: }
160: }
161:
162:
142: $this->parentName = ($this->global->coreParentFinder)($this);
143: }
144:
145: if ($this->referenceType === 'import') {
146: if ($this->parentName) {
147: throw new Latte\RuntimeException('Imported template cannot use {extends} or {layout}, use {import}');
148: }
149:
150: } elseif ($this->parentName) { $this->params = $params;
152: $this->createTemplate($this->parentName, $params, 'extends')->render($block);
153:
154: } elseif ($block !== null) { $this->renderBlock($block, $this->params);
156:
64:
65:
66: public function render(string $name, object|array $params = [], ?string $block = null): void
71: {
72: $template = $this->createTemplate($name, $this->processParams($params));
73: $template->global->coreCaptured = false;
74: $template->render($block);
75: }
76:
77:
78:
36:
37: public function render(?string $file = null, array $params = []): void
41: {
42: Nette\Utils\Arrays::toObject($params, $this);
43: if (isset($this->blueprint)) {
44: Nodes\TemplatePrintNode::printClass($this->getParameters(), $this->blueprint);
45: }
46: $this->latte->render($file ?: $this->file, $this);
47: }
48:
49:
50:
| $name | '/var/www/sedco.cz/data/www/sedco.imptest.cz/theme/FrontendModule/templates/Product/detail.latte'
|
| $params |
|
31: return $this->source;
32: }
33:
34:
35: public function send(Nette\Http\IRequest $httpRequest, Nette\Http\IResponse $httpResponse): void
39: {
40: if ($this->source instanceof Nette\Application\UI\Template) {
41: $this->source->render();
42:
43: } else {
44: echo $this->source;
45: }
148:
149: Arrays::invoke($this->onPresenter, $this, $this->presenter);
150: $response = $this->presenter->run(clone $request);
151:
152: if ($response instanceof Responses\ForwardResponse) {
153: $request = $response->getRequest();
154: goto process;
155: }
156:
157: Arrays::invoke($this->onResponse, $this, $response);
158: $response->send($this->httpRequest, $this->httpResponse);
159: }
160:
161:
162: public function createErrorRequest(\Throwable $e): ?Request
| $httpRequest |
|
| $httpResponse |
|
66: }
67:
68:
69: public function run(): void
73: {
74: try {
75: Arrays::invoke($this->onStartup, $this);
76: $this->processRequest($this->createInitialRequest());
77: Arrays::invoke($this->onShutdown, $this);
78:
79: } catch (\Throwable $e) {
80: $this->sendHttpCode($e);
9: $parameters = $container->getParameters();
10:
11: if ($timeLimit = $parameters['time_limit'] ?? null) {
12: @set_time_limit($timeLimit);
13: }
14:
15: if ($memoryLimit = $parameters['memory_limit'] ?? null) {
16: @ini_set('memory_limit', $memoryLimit . 'M');
17: }
18:
19: $container->getByType(Application::class)->run();
20: exit;