131:
132: if (!$block) {
133: $hint = $layer && ($t = Latte\Helpers::getSuggestion($this->getBlockNames($layer), $name))
134: ? ", did you mean '$t'?"
135: : '.';
136: $name = $layer ? "$layer $name" : $name;
137: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
138: }
139:
140: $this->filter(
141: fn() => reset($block->functions)($params),
142: $mod,
143: $block->contentType,
144: "block $name",
145: );
207: return $child;
208: }
209:
210:
211: private function filter(callable $producer, string|\Closure|null $targetType, string $contentType, string $name): void
215: {
216: if ($targetType === null || $targetType === $contentType) {
217: $producer();
218:
219: } elseif ($targetType instanceof \Closure) {
220: echo $targetType($this->capture($producer), $contentType);
221:
130: : ($this->blocks[self::LayerLocal][$name] ?? $this->blocks[self::LayerTop][$name] ?? null);
131:
132: if (!$block) {
133: $hint = $layer && ($t = Latte\Helpers::getSuggestion($this->getBlockNames($layer), $name))
134: ? ", did you mean '$t'?"
135: : '.';
136: $name = $layer ? "$layer $name" : $name;
137: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
138: }
139:
140: $this->filter(
141: fn() => reset($block->functions)($params),
142: $mod,
143: $block->contentType,
144: "block $name",
| $producer |
|
| $targetType | null
|
| $contentType | 'html'
|
| $name | 'block productSnippet'
|
211: if ($ʟ_tmp instanceof Nette\Application\UI\Renderable) $ʟ_tmp->redrawControl(null, false);
212: $ʟ_tmp->render() ;
213:
214: echo ' </ul>
215: </div>
216: </section>
217:
218: <section class="productDetail"';
219: echo ' id="', htmlspecialchars($this->global->snippetDriver->getHtmlId('productSnippet')), '"';
220: echo '>';
221: $this->renderBlock('productSnippet', [], null, 'snippet') /* line 68 */;
222: echo '</section>
223: <script>
224: // AUTOSUBMIT & RESET RADIO
225: $(document).on( \'click\', \'input[data-option-select-autosubmit][type="radio"]\', function(){
58: {var $productVideos = $record->allEshopProductVideos->where(['active' => true, 'langActive' => true, 'langLanguage.shortcut' => $locale])->order('rank ASC')}
59:
60: <section class="breadcrumb uk-visible@s">
61: <div class="container">
62: <ul class="uk-breadcrumb">
63: {control breadcrumbs}
64: </ul>
65: </div>
66: </section>
67:
68: <section class="productDetail" n:snippet="productSnippet">
69: {var $productImages = $record->allEshopProductImages->where(['langActive' => true, 'langLanguage.shortcut' => $locale])->order('rank')}
70: {ifset $currentVariant}
71: {var $variantImages = $currentVariant->allEshopProductVariantImages->where(['langActive' => true, 'langLanguage.shortcut' => $locale])->order('rank')}
72: {/ifset}
| $name | 'productSnippet'
|
| $params | array (0)
|
| $mod | null
|
| $layer | 'snippet'
|
131:
132: if (!$block) {
133: $hint = $layer && ($t = Latte\Helpers::getSuggestion($this->getBlockNames($layer), $name))
134: ? ", did you mean '$t'?"
135: : '.';
136: $name = $layer ? "$layer $name" : $name;
137: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
138: }
139:
140: $this->filter(
141: fn() => reset($block->functions)($params),
142: $mod,
143: $block->contentType,
144: "block $name",
145: );
207: return $child;
208: }
209:
210:
211: private function filter(callable $producer, string|\Closure|null $targetType, string $contentType, string $name): void
215: {
216: if ($targetType === null || $targetType === $contentType) {
217: $producer();
218:
219: } elseif ($targetType instanceof \Closure) {
220: echo $targetType($this->capture($producer), $contentType);
221:
130: : ($this->blocks[self::LayerLocal][$name] ?? $this->blocks[self::LayerTop][$name] ?? null);
131:
132: if (!$block) {
133: $hint = $layer && ($t = Latte\Helpers::getSuggestion($this->getBlockNames($layer), $name))
134: ? ", did you mean '$t'?"
135: : '.';
136: $name = $layer ? "$layer $name" : $name;
137: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
138: }
139:
140: $this->filter(
141: fn() => reset($block->functions)($params),
142: $mod,
143: $block->contentType,
144: "block $name",
| $producer |
|
| $targetType | 'html'
|
| $contentType | 'html'
|
| $name | 'block content'
|
341:
342: public function blockContent(array $ʟ_args): void
344: {
345: extract($this->params);
346: extract($ʟ_args);
347: unset($ʟ_args);
348:
349: $this->global->snippetDriver->enter('content', 'area');
350: try {
351: $this->renderBlock('content', [], 'html') /* line 78 */;
352: } finally {
353: $this->global->snippetDriver->leave();
354: }
355: }
68: {/block}
69: </head>
70: <body n:class="$bodyClass ? $bodyClass">
71: {control scripts-body}
72:
73: {block bodyStructure}
74: {snippetArea header}
75: {include file '@header.latte'}
76: {/snippetArea}
77: {snippetArea content}
78: {include block content}
79: {/snippetArea}
80: {snippetArea footer}
81: {include file '@footer.latte'}
82: {/snippetArea}
| $name | 'content'
|
| $params | array (0)
|
| $mod | 'html'
|
131:
132: if (!$block) {
133: $hint = $layer && ($t = Latte\Helpers::getSuggestion($this->getBlockNames($layer), $name))
134: ? ", did you mean '$t'?"
135: : '.';
136: $name = $layer ? "$layer $name" : $name;
137: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
138: }
139:
140: $this->filter(
141: fn() => reset($block->functions)($params),
142: $mod,
143: $block->contentType,
144: "block $name",
145: );
207: return $child;
208: }
209:
210:
211: private function filter(callable $producer, string|\Closure|null $targetType, string $contentType, string $name): void
215: {
216: if ($targetType === null || $targetType === $contentType) {
217: $producer();
218:
219: } elseif ($targetType instanceof \Closure) {
220: echo $targetType($this->capture($producer), $contentType);
221:
130: : ($this->blocks[self::LayerLocal][$name] ?? $this->blocks[self::LayerTop][$name] ?? null);
131:
132: if (!$block) {
133: $hint = $layer && ($t = Latte\Helpers::getSuggestion($this->getBlockNames($layer), $name))
134: ? ", did you mean '$t'?"
135: : '.';
136: $name = $layer ? "$layer $name" : $name;
137: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
138: }
139:
140: $this->filter(
141: fn() => reset($block->functions)($params),
142: $mod,
143: $block->contentType,
144: "block $name",
| $producer |
|
| $targetType | null
|
| $contentType | 'html'
|
| $name | 'block content'
|
311:
312:
313: public function blockBodyStructure(array $ʟ_args): void
315: {
316: extract($this->params);
317: extract($ʟ_args);
318: unset($ʟ_args);
319:
320: $this->renderBlock('header', [], null, 'snippet') ;
321: $this->renderBlock('content', [], null, 'snippet') /* line 77 */;
322: $this->renderBlock('footer', [], null, 'snippet') ;
323: }
324:
325:
67: {control canonical}
68: {/block}
69: </head>
70: <body n:class="$bodyClass ? $bodyClass">
71: {control scripts-body}
72:
73: {block bodyStructure}
74: {snippetArea header}
75: {include file '@header.latte'}
76: {/snippetArea}
77: {snippetArea content}
78: {include block content}
79: {/snippetArea}
80: {snippetArea footer}
81: {include file '@footer.latte'}
| $name | 'content'
|
| $params | array (0)
|
| $mod | null
|
| $layer | 'snippet'
|
131:
132: if (!$block) {
133: $hint = $layer && ($t = Latte\Helpers::getSuggestion($this->getBlockNames($layer), $name))
134: ? ", did you mean '$t'?"
135: : '.';
136: $name = $layer ? "$layer $name" : $name;
137: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
138: }
139:
140: $this->filter(
141: fn() => reset($block->functions)($params),
142: $mod,
143: $block->contentType,
144: "block $name",
145: );
207: return $child;
208: }
209:
210:
211: private function filter(callable $producer, string|\Closure|null $targetType, string $contentType, string $name): void
215: {
216: if ($targetType === null || $targetType === $contentType) {
217: $producer();
218:
219: } elseif ($targetType instanceof \Closure) {
220: echo $targetType($this->capture($producer), $contentType);
221:
130: : ($this->blocks[self::LayerLocal][$name] ?? $this->blocks[self::LayerTop][$name] ?? null);
131:
132: if (!$block) {
133: $hint = $layer && ($t = Latte\Helpers::getSuggestion($this->getBlockNames($layer), $name))
134: ? ", did you mean '$t'?"
135: : '.';
136: $name = $layer ? "$layer $name" : $name;
137: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
138: }
139:
140: $this->filter(
141: fn() => reset($block->functions)($params),
142: $mod,
143: $block->contentType,
144: "block $name",
| $producer |
|
| $targetType | 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 73 */;
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() ;
63: </title>
64: {/block}
65:
66: {block canonical}
67: {control canonical}
68: {/block}
69: </head>
70: <body n:class="$bodyClass ? $bodyClass">
71: {control scripts-body}
72:
73: {block bodyStructure}
74: {snippetArea header}
75: {include file '@header.latte'}
76: {/snippetArea}
77: {snippetArea content}
| $name | 'bodyStructure'
|
| $params |
|
100: }
101:
102: } elseif ($this->parentName) { $this->params = $params;
104: $this->createTemplate($this->parentName, $params, 'extends')->render($block);
105:
106: } elseif ($block !== null) { $this->renderBlock($block, $this->params);
108:
109: } else {
110: $this->main($params);
111: }
112: }
113:
114:
94: $this->parentName = ($this->global->coreParentFinder)($this);
95: }
96:
97: if ($this->referenceType === 'import') {
98: if ($this->parentName) {
99: throw new Latte\RuntimeException('Imported template cannot use {extends} or {layout}, use {import}');
100: }
101:
102: } elseif ($this->parentName) { $this->params = $params;
104: $this->createTemplate($this->parentName, $params, 'extends')->render($block);
105:
106: } elseif ($block !== null) { $this->renderBlock($block, $this->params);
108:
66:
67:
68: public function render(string $name, object|array $params = [], ?string $block = null): void
73: {
74: $template = $this->createTemplate($name, $this->processParams($params));
75: $template->global->coreCaptured = false;
76: $template->render($block);
77: }
78:
79:
80:
37:
38: public function render(?string $file = null, array $params = []): void
42: {
43: Nette\Utils\Arrays::toObject($params, $this);
44: if (isset($this->blueprint)) {
45: Nodes\TemplatePrintNode::printClass($this->getParameters(), $this->blueprint);
46: }
47: $this->latte->render($file ?: $this->file, $this);
48: }
49:
50:
51:
| $name | '/var/www/clients/client4/web82/web/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: }
149:
150: Arrays::invoke($this->onPresenter, $this, $this->presenter);
151: $response = $this->presenter->run(clone $request);
152:
153: if ($response instanceof Responses\ForwardResponse) {
154: $request = $response->getRequest();
155: goto process;
156: }
157:
158: Arrays::invoke($this->onResponse, $this, $response);
159: $response->send($this->httpRequest, $this->httpResponse);
160: }
161:
162:
163: public function createErrorRequest(\Throwable $e): ?Request
| $httpRequest |
|
| $httpResponse |
|
67: }
68:
69:
70: public function run(): void
74: {
75: try {
76: Arrays::invoke($this->onStartup, $this);
77: $this->processRequest($this->createInitialRequest());
78: Arrays::invoke($this->onShutdown, $this);
79:
80: } catch (\Throwable $e) {
81: $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;