72: })
73: ->setSortable('percentage24h');
74: $c->addColumnText('marketCap', $this->t('app.geckoCcList.marketCap'))
75: ->setRenderer(function($item) {
76: return number_format($item['marketCap'], 0, ',', ' ') . ' €';
77: })
78: ->setAlign('right')
79: ->setSortable('marketCap');
80: $c->addColumnText('totalVolume', $this->t('app.geckoCcList.totalVolume'))
81: ->setRenderer(function($item) {
82: return number_format($item['totalVolume'], 0, ',', ' ') . ' €';
83: })
84: ->setAlign('right')
85: ->setSortable('totalVolume');
86:
| $num | null
|
| $decimals | 0
|
| $decimal_separator | ','
|
| $thousands_separator | ' '
|
inner-code
37: }
38:
39: if ($renderer->getConditionCallback() !== null) {
40: if (call_user_func_array($renderer->getConditionCallback(), $args) === false) {
41: throw new DataGridColumnRendererException;
42: }
43:
44: return call_user_func_array($renderer->getCallback(), $args);
45: }
46:
47: return call_user_func_array($renderer->getCallback(), $args);
48: }
49:
50:
51:
protected $editableValueCallback = null;
98:
99: public function render(Row $row)
103: {
104: try {
105: return $this->useRenderer($row);
106: } catch (DataGridColumnRendererException $e) {
107:
1080: $item = $row->getItem() ;
1081: echo "\n";
1082: if ($column->hasTemplate()) {
1083: $this->createTemplate($column->getTemplate(), array_merge(['row' => $row, 'item' => $item, ], $column->getTemplateVariables(), []) + $this->params, 'include')->renderToContentType('html') ;
1084: } else {
1085: if ($this->hasBlock($col)) {
1086: $this->renderBlock($col, ['item' => $item] + [], 'html') ;
1087: } else {
1088: if ($column->isTemplateEscaped()) {
1089: echo ' ';
1090: echo LR\Filters::escapeHtmlText($column->render($row)) /* line 529 */;
1091: echo "\n";
1092: } else {
1093: echo ' ';
1094: echo $column->render($row) ;
519: {var $col = 'col-' . $key}
520: {var $item = $row->getItem()}
521:
522: {if $column->hasTemplate()}
523: {include $column->getTemplate(), row => $row, item => $item, (expand) $column->getTemplateVariables()}
524: {else}
525: {ifset #$col}
526: {include #$col, item => $item}
527: {else}
528: {if $column->isTemplateEscaped()}
529: {$column->render($row)}
530: {else}
531: {$column->render($row)|noescape}
532: {/if}
533: {/ifset}
299:
300: if (!$block) {
301: $hint = ($t = Latte\Helpers::getSuggestion($this->getBlockNames($layer), $name))
302: ? ", did you mean '$t'?"
303: : '.';
304: $name = $layer ? "$layer $name" : $name;
305: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
306: }
307:
308: $this->filter(
309: function () use ($block, $params): void { reset($block->functions)($params); },
310: $mod,
311: $block->contentType,
312: "block $name"
313: );
354: $block->functions = array_merge($block->functions, $functions);
355: }
356:
357:
358: private function filter(callable $function, $mod, string $contentType, string $name): void
362: {
363: if ($mod === null || $mod === $contentType) {
364: $function();
365:
366: } elseif ($mod instanceof \Closure) {
367: echo $mod($this->capture($function), $contentType);
368:
302: ? ", did you mean '$t'?"
303: : '.';
304: $name = $layer ? "$layer $name" : $name;
305: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
306: }
307:
308: $this->filter(
309: function () use ($block, $params): void { reset($block->functions)($params); },
310: $mod,
311: $block->contentType,
312: "block $name"
313: );
314: }
315:
316:
| $function |
|
| $mod | 'html'
|
| $contentType | 'html'
|
| $name | 'block column-value'
|
1411: ';
1412: }
1413: $iterations = 0;
1414: foreach ($iterator = $ʟ_it = new LR\CachingIterator($columns, $ʟ_it ?? null) as $key => $column) {
1415: $column = $row->applyColumnCallback($key, clone $column) ;
1416: echo "\n";
1417: $td = $column->getElementForRender('td', $key, $row) ;
1418: echo ' ';
1419: echo $td->startTag() ;
1420: echo "\n";
1421: $this->renderBlock('column-value', ['column' => $column, 'row' => $row, 'key' => $key] + get_defined_vars(), 'html') /* line 293 */;
1422: echo ' ';
1423: echo $td->endTag() ;
1424: echo "\n";
1425: $iterations++;
283: <td n:if="$hasGroupActions" class="col-checkbox">
284: {if $row->hasGroupAction()}
285: <input n:class="$control->shouldUseHappyComponents() ? 'happy gray-border' , primary" type="checkbox" data-check="{$control->getFullName()}" data-check-all-{$control->getFullName()|noescape} name="{$control->getFullName()|lower}_group_action_item[{$row->getId()}]">
286: {/if}
287: </td>
288: {foreach $columns as $key => $column}
289: {php $column = $row->applyColumnCallback($key, clone $column)}
290:
291: {var $td = $column->getElementForRender('td', $key, $row)}
292: {$td->startTag()|noescape}
293: {include column-value, column => $column, row => $row, key => $key}
294: {$td->endTag()|noescape}
295: {/foreach}
296: <td n:if="$actions || $control->isSortable() || $itemsDetail || $inlineEdit || $inlineAdd" class="col-action">
297: {foreach $actions as $key => $action}
| $name | 'column-value'
|
| $params |
|
| $mod | 'html'
|
299:
300: if (!$block) {
301: $hint = ($t = Latte\Helpers::getSuggestion($this->getBlockNames($layer), $name))
302: ? ", did you mean '$t'?"
303: : '.';
304: $name = $layer ? "$layer $name" : $name;
305: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
306: }
307:
308: $this->filter(
309: function () use ($block, $params): void { reset($block->functions)($params); },
310: $mod,
311: $block->contentType,
312: "block $name"
313: );
354: $block->functions = array_merge($block->functions, $functions);
355: }
356:
357:
358: private function filter(callable $function, $mod, string $contentType, string $name): void
362: {
363: if ($mod === null || $mod === $contentType) {
364: $function();
365:
366: } elseif ($mod instanceof \Closure) {
367: echo $mod($this->capture($function), $contentType);
368:
302: ? ", did you mean '$t'?"
303: : '.';
304: $name = $layer ? "$layer $name" : $name;
305: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
306: }
307:
308: $this->filter(
309: function () use ($block, $params): void { reset($block->functions)($params); },
310: $mod,
311: $block->contentType,
312: "block $name"
313: );
314: }
315:
316:
| $function |
|
| $mod | null
|
| $contentType | 'html'
|
| $name | 'block items'
|
1264:
1265: public function blockTbody1(array $ʟ_args): void
1267: {
1268: extract($this->params);
1269: extract($ʟ_args);
1270: unset($ʟ_args);
1271: $this->global->snippetDriver->enter("tbody", 'static');
1272: try {
1273: echo ' ';
1274: $this->renderBlock('items', [], null, 'snippet') /* line 235 */;
1275: echo "\n";
1276: } finally {
1277: $this->global->snippetDriver->leave();
1278: }
225: <th n:if="$actions || $control->isSortable() || $itemsDetail || $inlineEdit || $inlineAdd" class="col-action text-center">
226: {if !$control->hasAutoSubmit() && !$control->hasOuterFilterRendering()}
227: {input $filter['filter']['submit']}
228: {/if}
229: </th>
230: </tr>
231: </thead>
232:
233: {block tbody}
234: <tbody n:snippet="tbody" {if $control->isSortable()}data-sortable data-sortable-url="{plink $control->getSortableHandler()}" data-sortable-parent-path="{$control->getSortableParentPath()}"{/if}>
235: {snippetArea items}
236: {if $inlineAdd && $inlineAdd->isPositionTop()}
237: {include inlineAddRow, columns => $columns}
238: {/if}
239:
| $name | 'items'
|
| $params | array (0)
|
| $mod | null
|
| $layer | 'snippet'
|
299:
300: if (!$block) {
301: $hint = ($t = Latte\Helpers::getSuggestion($this->getBlockNames($layer), $name))
302: ? ", did you mean '$t'?"
303: : '.';
304: $name = $layer ? "$layer $name" : $name;
305: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
306: }
307:
308: $this->filter(
309: function () use ($block, $params): void { reset($block->functions)($params); },
310: $mod,
311: $block->contentType,
312: "block $name"
313: );
354: $block->functions = array_merge($block->functions, $functions);
355: }
356:
357:
358: private function filter(callable $function, $mod, string $contentType, string $name): void
362: {
363: if ($mod === null || $mod === $contentType) {
364: $function();
365:
366: } elseif ($mod instanceof \Closure) {
367: echo $mod($this->capture($function), $contentType);
368:
302: ? ", did you mean '$t'?"
303: : '.';
304: $name = $layer ? "$layer $name" : $name;
305: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
306: }
307:
308: $this->filter(
309: function () use ($block, $params): void { reset($block->functions)($params); },
310: $mod,
311: $block->contentType,
312: "block $name"
313: );
314: }
315:
316:
| $function |
|
| $mod | null
|
| $contentType | 'html'
|
| $name | 'block tbody'
|
732: if ($control->isSortable()) {
733: echo 'data-sortable data-sortable-url="';
734: echo LR\Filters::escapeHtmlAttr($this->global->uiPresenter->link($control->getSortableHandler())) ;
735: echo '" data-sortable-parent-path="';
736: echo LR\Filters::escapeHtmlAttr($control->getSortableParentPath()) ;
737: echo '"';
738: }
739: echo ' id="' . htmlspecialchars($this->global->snippetDriver->getHtmlId('tbody')) . '"';
740: echo '>
741: ';
742: $this->renderBlock('tbody', [], null, 'snippet');
743: echo ' </tbody>
744: ';
745:
746: }
1: {**
2: * @param Column[] $columns Available columns
3: * @param Action[] $actions Available actions
4: * @param Export[] $exports Available exports
5: * @param Filter[] $filters Available filters
6: * @param ToolBarButton[] $toolbarButtons Available toolbarButtons
7: * @param Form $filter Workaround for latte snippets
8: * @param Row[] $rows List of rows (each contain a item from data source)
9: * @param DataGrid $control Parent (DataGrid)
10: * @param string $originalTemplate Original template file path
11: * @param string $iconPrefix Icon prefix (fa fa-)
12: * @param array $columnsVisibility What columns are visible
13: * @param InlineEdit|null $inlineEdit Inline editing data
14: * @param InlineEdit|null $inlineAdd Inline add data
15: *}
| $name | 'tbody'
|
| $params | array (0)
|
| $mod | null
|
| $layer | 'snippet'
|
299:
300: if (!$block) {
301: $hint = ($t = Latte\Helpers::getSuggestion($this->getBlockNames($layer), $name))
302: ? ", did you mean '$t'?"
303: : '.';
304: $name = $layer ? "$layer $name" : $name;
305: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
306: }
307:
308: $this->filter(
309: function () use ($block, $params): void { reset($block->functions)($params); },
310: $mod,
311: $block->contentType,
312: "block $name"
313: );
354: $block->functions = array_merge($block->functions, $functions);
355: }
356:
357:
358: private function filter(callable $function, $mod, string $contentType, string $name): void
362: {
363: if ($mod === null || $mod === $contentType) {
364: $function();
365:
366: } elseif ($mod instanceof \Closure) {
367: echo $mod($this->capture($function), $contentType);
368:
302: ? ", did you mean '$t'?"
303: : '.';
304: $name = $layer ? "$layer $name" : $name;
305: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
306: }
307:
308: $this->filter(
309: function () use ($block, $params): void { reset($block->functions)($params); },
310: $mod,
311: $block->contentType,
312: "block $name"
313: );
314: }
315:
316:
| $function |
|
| $mod | null
|
| $contentType | 'html'
|
| $name | 'block tbody'
|
1149: public function blockTable(array $ʟ_args): void
1151: {
1152: extract($this->params);
1153: extract($ʟ_args);
1154: unset($ʟ_args);
1155: $this->global->snippetDriver->enter("table", 'static');
1156: try {
1157: $this->renderBlock('header', get_defined_vars()) ;
1158: echo "\n";
1159: $this->renderBlock('tbody', get_defined_vars()) /* line 233 */;
1160: echo "\n";
1161: $this->renderBlock('tfoot', get_defined_vars()) ;
1162: echo "\n";
1163: } finally {
223: {$th->endTag()|noescape}
224: {/foreach}
225: <th n:if="$actions || $control->isSortable() || $itemsDetail || $inlineEdit || $inlineAdd" class="col-action text-center">
226: {if !$control->hasAutoSubmit() && !$control->hasOuterFilterRendering()}
227: {input $filter['filter']['submit']}
228: {/if}
229: </th>
230: </tr>
231: </thead>
232:
233: {block tbody}
234: <tbody n:snippet="tbody" {if $control->isSortable()}data-sortable data-sortable-url="{plink $control->getSortableHandler()}" data-sortable-parent-path="{$control->getSortableParentPath()}"{/if}>
235: {snippetArea items}
236: {if $inlineAdd && $inlineAdd->isPositionTop()}
237: {include inlineAddRow, columns => $columns}
299:
300: if (!$block) {
301: $hint = ($t = Latte\Helpers::getSuggestion($this->getBlockNames($layer), $name))
302: ? ", did you mean '$t'?"
303: : '.';
304: $name = $layer ? "$layer $name" : $name;
305: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
306: }
307:
308: $this->filter(
309: function () use ($block, $params): void { reset($block->functions)($params); },
310: $mod,
311: $block->contentType,
312: "block $name"
313: );
354: $block->functions = array_merge($block->functions, $functions);
355: }
356:
357:
358: private function filter(callable $function, $mod, string $contentType, string $name): void
362: {
363: if ($mod === null || $mod === $contentType) {
364: $function();
365:
366: } elseif ($mod instanceof \Closure) {
367: echo $mod($this->capture($function), $contentType);
368:
302: ? ", did you mean '$t'?"
303: : '.';
304: $name = $layer ? "$layer $name" : $name;
305: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
306: }
307:
308: $this->filter(
309: function () use ($block, $params): void { reset($block->functions)($params); },
310: $mod,
311: $block->contentType,
312: "block $name"
313: );
314: }
315:
316:
| $function |
|
| $mod | null
|
| $contentType | 'html'
|
| $name | 'block table'
|
182: unset($ʟ_args);
183: echo ' <table class="';
184: $this->renderBlock('table-class', get_defined_vars(), function ($s, $type) {
185: $ʟ_fi = new LR\FilterInfo($type);
186: return LR\Filters::convertTo($ʟ_fi, 'htmlAttr', $s);
187: }) ;
188: echo '"';
189: echo ' id="' . htmlspecialchars($this->global->snippetDriver->getHtmlId('table')) . '"';
190: echo '>
191: ';
192: $this->renderBlock('table', [], null, 'snippet');
193: echo ' </table>
194: ';
195:
196: }
1: {**
2: * @param Column[] $columns Available columns
3: * @param Action[] $actions Available actions
4: * @param Export[] $exports Available exports
5: * @param Filter[] $filters Available filters
6: * @param ToolBarButton[] $toolbarButtons Available toolbarButtons
7: * @param Form $filter Workaround for latte snippets
8: * @param Row[] $rows List of rows (each contain a item from data source)
9: * @param DataGrid $control Parent (DataGrid)
10: * @param string $originalTemplate Original template file path
11: * @param string $iconPrefix Icon prefix (fa fa-)
12: * @param array $columnsVisibility What columns are visible
13: * @param InlineEdit|null $inlineEdit Inline editing data
14: * @param InlineEdit|null $inlineAdd Inline add data
15: *}
| $name | 'table'
|
| $params | array (0)
|
| $mod | null
|
| $layer | 'snippet'
|
299:
300: if (!$block) {
301: $hint = ($t = Latte\Helpers::getSuggestion($this->getBlockNames($layer), $name))
302: ? ", did you mean '$t'?"
303: : '.';
304: $name = $layer ? "$layer $name" : $name;
305: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
306: }
307:
308: $this->filter(
309: function () use ($block, $params): void { reset($block->functions)($params); },
310: $mod,
311: $block->contentType,
312: "block $name"
313: );
354: $block->functions = array_merge($block->functions, $functions);
355: }
356:
357:
358: private function filter(callable $function, $mod, string $contentType, string $name): void
362: {
363: if ($mod === null || $mod === $contentType) {
364: $function();
365:
366: } elseif ($mod instanceof \Closure) {
367: echo $mod($this->capture($function), $contentType);
368:
302: ? ", did you mean '$t'?"
303: : '.';
304: $name = $layer ? "$layer $name" : $name;
305: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
306: }
307:
308: $this->filter(
309: function () use ($block, $params): void { reset($block->functions)($params); },
310: $mod,
311: $block->contentType,
312: "block $name"
313: );
314: }
315:
316:
| $function |
|
| $mod | null
|
| $contentType | 'html'
|
| $name | 'block data'
|
1128: try {
1129: echo ' ';
1130: $form = $this->global->formsStack[] = $this->global->uiControl["filter"];
1131: Nette\Bridges\FormsLatte\Runtime::initializeForm($form);
1132: echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin($form, ['class' => 'ajax']) ;
1133: echo "\n";
1134: if ($control->hasOuterFilterRendering()) {
1135: $this->renderBlock('outer-filters', get_defined_vars()) ;
1136: echo "\n";
1137: }
1138: $this->renderBlock('data', get_defined_vars()) /* line 69 */;
1139: echo ' ';
1140: echo Nette\Bridges\FormsLatte\Runtime::renderFormEnd(array_pop($this->global->formsStack));
1141: echo "\n";
1142: } finally {
59: </div>
60: <div class="col-sm-12" n:if="!$control->hasAutoSubmit()">
61: <div class="text-right datagrid-manual-submit">
62: {input $filter['filter']['submit']}
63: </div>
64: </div>
65: </div>
66: </div>
67: {/block}
68: {/if}
69: <table class="{block table-class}table table-hover table-striped table-bordered table-sm{/block}" n:snippet="table" n:block="data">
70: <thead n:block="header">
71: <tr class="row-group-actions" n:if="$hasGroupActions || $exports || $toolbarButtons || $control->canHideColumns() || $inlineAdd" n:block="group-actions">
72: <th colspan="{$control->getColumnsCount()}" class="ublaboo-datagrid-th-form-inline">
73: {if $hasGroupActions}
299:
300: if (!$block) {
301: $hint = ($t = Latte\Helpers::getSuggestion($this->getBlockNames($layer), $name))
302: ? ", did you mean '$t'?"
303: : '.';
304: $name = $layer ? "$layer $name" : $name;
305: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
306: }
307:
308: $this->filter(
309: function () use ($block, $params): void { reset($block->functions)($params); },
310: $mod,
311: $block->contentType,
312: "block $name"
313: );
354: $block->functions = array_merge($block->functions, $functions);
355: }
356:
357:
358: private function filter(callable $function, $mod, string $contentType, string $name): void
362: {
363: if ($mod === null || $mod === $contentType) {
364: $function();
365:
366: } elseif ($mod instanceof \Closure) {
367: echo $mod($this->capture($function), $contentType);
368:
302: ? ", did you mean '$t'?"
303: : '.';
304: $name = $layer ? "$layer $name" : $name;
305: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
306: }
307:
308: $this->filter(
309: function () use ($block, $params): void { reset($block->functions)($params); },
310: $mod,
311: $block->contentType,
312: "block $name"
313: );
314: }
315:
316:
| $function |
|
| $mod | null
|
| $contentType | 'html'
|
| $name | 'block gridSnippets'
|
1102:
1103: public function blockGrid(array $ʟ_args): void
1105: {
1106: extract($this->params);
1107: extract($ʟ_args);
1108: unset($ʟ_args);
1109: $this->global->snippetDriver->enter("grid", 'static');
1110: try {
1111: echo ' ';
1112: $this->renderBlock('gridSnippets', [], null, 'snippet') /* line 19 */;
1113: echo "\n";
1114: } finally {
1115: $this->global->snippetDriver->leave();
1116: }
9: * @param DataGrid $control Parent (DataGrid)
10: * @param string $originalTemplate Original template file path
11: * @param string $iconPrefix Icon prefix (fa fa-)
12: * @param array $columnsVisibility What columns are visible
13: * @param InlineEdit|null $inlineEdit Inline editing data
14: * @param InlineEdit|null $inlineAdd Inline add data
15: *}
16:
17: <div class="{block datagrid-class}datagrid datagrid-{$control->getFullName()}{/block}" data-refresh-state="{link refreshState!}">
18: <div n:snippet="grid">
19: {snippetArea gridSnippets}
20: {form filter, class => 'ajax'}
21: {if $control->hasOuterFilterRendering()}
22: {block outer-filters}
23: <div class="row text-right datagrid-collapse-filters-button-row" n:if="$control->hasCollapsibleOuterFilters()">
| $name | 'gridSnippets'
|
| $params | array (0)
|
| $mod | null
|
| $layer | 'snippet'
|
299:
300: if (!$block) {
301: $hint = ($t = Latte\Helpers::getSuggestion($this->getBlockNames($layer), $name))
302: ? ", did you mean '$t'?"
303: : '.';
304: $name = $layer ? "$layer $name" : $name;
305: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
306: }
307:
308: $this->filter(
309: function () use ($block, $params): void { reset($block->functions)($params); },
310: $mod,
311: $block->contentType,
312: "block $name"
313: );
354: $block->functions = array_merge($block->functions, $functions);
355: }
356:
357:
358: private function filter(callable $function, $mod, string $contentType, string $name): void
362: {
363: if ($mod === null || $mod === $contentType) {
364: $function();
365:
366: } elseif ($mod instanceof \Closure) {
367: echo $mod($this->capture($function), $contentType);
368:
302: ? ", did you mean '$t'?"
303: : '.';
304: $name = $layer ? "$layer $name" : $name;
305: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
306: }
307:
308: $this->filter(
309: function () use ($block, $params): void { reset($block->functions)($params); },
310: $mod,
311: $block->contentType,
312: "block $name"
313: );
314: }
315:
316:
| $function |
|
| $mod | null
|
| $contentType | 'html'
|
| $name | 'block grid'
|
22: $ʟ_fi = new LR\FilterInfo($type);
23: return LR\Filters::convertTo($ʟ_fi, 'htmlAttr', $s);
24: }) ;
25: echo '" data-refresh-state="';
26: echo LR\Filters::escapeHtmlAttr($this->global->uiControl->link("refreshState!")) ;
27: echo '">
28: <div';
29: echo ' id="' . htmlspecialchars($this->global->snippetDriver->getHtmlId('grid')) . '"';
30: echo '>
31: ';
32: $this->renderBlock('grid', [], null, 'snippet');
33: echo ' </div>
34: </div>
35:
36:
1: {**
2: * @param Column[] $columns Available columns
3: * @param Action[] $actions Available actions
4: * @param Export[] $exports Available exports
5: * @param Filter[] $filters Available filters
6: * @param ToolBarButton[] $toolbarButtons Available toolbarButtons
7: * @param Form $filter Workaround for latte snippets
8: * @param Row[] $rows List of rows (each contain a item from data source)
9: * @param DataGrid $control Parent (DataGrid)
10: * @param string $originalTemplate Original template file path
11: * @param string $iconPrefix Icon prefix (fa fa-)
12: * @param array $columnsVisibility What columns are visible
13: * @param InlineEdit|null $inlineEdit Inline editing data
14: * @param InlineEdit|null $inlineAdd Inline add data
15: *}
| $name | 'grid'
|
| $params | array (0)
|
| $mod | null
|
| $layer | 'snippet'
|
161: public function render(?string $block = null): void
166: {
167: $level = ob_get_level();
168: try {
169: $this->prepare();
170: if (!$this->doRender($block)) {
171: $this->main();
172: }
173:
174: } catch (\Throwable $e) {
175: while (ob_get_level() > $level) {
193:
194: if ($this->referenceType === 'import') {
195: if ($this->parentName) {
196: throw new Latte\RuntimeException('Imported template cannot use {extends} or {layout}, use {import}');
197: }
198:
199: } elseif ($this->parentName) { ob_start(function () {});
201: $this->params = $this->main();
202: ob_end_clean();
203: $this->createTemplate($this->parentName, $this->params, 'extends')->render($block);
204:
205: } elseif ($block !== null) { $this->renderBlock($block, $this->params);
207:
160:
161: public function render(?string $block = null): void
166: {
167: $level = ob_get_level();
168: try {
169: $this->prepare();
170: if (!$this->doRender($block)) {
171: $this->main();
172: }
173:
174: } catch (\Throwable $e) {
92:
93: public function render(string $name, $params = [], ?string $block = null): void
98: {
99: $template = $this->createTemplate($name, $this->processParams($params));
100: $template->global->coreCaptured = false;
101: ($this->probe)($template);
102: $template->render($block);
103: }
104:
105:
106:
36: return $this->latte;
37: }
38:
39:
40: public function render(?string $file = null, array $params = []): void
44: {
45: Nette\Utils\Arrays::toObject($params, $this);
46: $this->latte->render($file ?: $this->file, $this);
47: }
48:
49:
50:
| $name | '/var/www/bitcoinzmenaren.sk/app/Components/GeckoCcList/datagrid_template.latte'
|
| $params |
|
589:
590: $template->filter = $this['filter'];
594:
595: $template->setFile($this->getTemplateFile());
599: $template->render();
600: }
601:
602:
603:
4:
5: final class Templatee44f9ea609 extends Latte\Runtime\Template
7: {
8:
9: public function main(): array
10: {
11: extract($this->params);
12: $_tmp = $this->global->uiControl->getComponent("grid");
13: if ($_tmp instanceof Nette\Application\UI\Renderable) $_tmp->redrawControl(null, false);
14: $_tmp->render();
15: return get_defined_vars();
16: }
17:
18:
161: public function render(?string $block = null): void
166: {
167: $level = ob_get_level();
168: try {
169: $this->prepare();
170: if (!$this->doRender($block)) {
171: $this->main();
172: }
173:
174: } catch (\Throwable $e) {
175: while (ob_get_level() > $level) {
92:
93: public function render(string $name, $params = [], ?string $block = null): void
98: {
99: $template = $this->createTemplate($name, $this->processParams($params));
100: $template->global->coreCaptured = false;
101: ($this->probe)($template);
102: $template->render($block);
103: }
104:
105:
106:
36: return $this->latte;
37: }
38:
39:
40: public function render(?string $file = null, array $params = []): void
44: {
45: Nette\Utils\Arrays::toObject($params, $this);
46: $this->latte->render($file ?: $this->file, $this);
47: }
48:
49:
50:
| $name | '/var/www/bitcoinzmenaren.sk/app/Components/GeckoCcList/template.latte'
|
| $params |
|
26: private ITranslator $translator,
27: private DataGridFactory $dataGridFactory,
28: private CoinGeckoClient $coinGeckoClient,
29: Storage $storage
30: ) {
31: $this->cache = new Cache($storage, __CLASS__);
32: }
33:
34: public function render()
35: {
36: $this->template->setFile(self::TPL)->render();
37: }
38:
39: protected function createComponent(string $name): ?Nette\ComponentModel\IComponent
40: {
49: $ᴛ_contributteTranslationMessage = isset($ᴛ_contributteTranslationPrefix) && !\Contributte\Translation\Helpers::isAbsoluteMessage("app.geckoCc.header") ? implode(".", $ᴛ_contributteTranslationPrefix) . "." . "app.geckoCc.header" : "app.geckoCc.header";
50: }
51:
52: echo LR\Filters::escapeHtmlText(call_user_func($this->filters->translate, $ᴛ_contributteTranslationMessage));
53: echo '</span></h1>
54: </div>
55: <div class="col-md-12 text-center blog-detail table-responsive">
56: ';
57: $_tmp = $this->global->uiControl->getComponent("geckoCc");
58: if ($_tmp instanceof Nette\Application\UI\Renderable) $_tmp->redrawControl(null, false);
59: $_tmp->render();
60: echo ' </div>
61: </div>
62: </div>
63: </div>
1: {block content}
2: <section class="panel" id="contact">
3: <div class="inner">
4: <div class="container-fluid container-blog">
5: <div class="container">
6: <div class="row">
7: <div class="col-lg-12 title-text">
8: <h1><span>{_app.geckoCc.header}</span></h1>
9: </div>
10: <div class="col-md-12 text-center blog-detail table-responsive">
11: {control geckoCc}
12: </div>
13: </div>
14: </div>
15: </div>
299:
300: if (!$block) {
301: $hint = ($t = Latte\Helpers::getSuggestion($this->getBlockNames($layer), $name))
302: ? ", did you mean '$t'?"
303: : '.';
304: $name = $layer ? "$layer $name" : $name;
305: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
306: }
307:
308: $this->filter(
309: function () use ($block, $params): void { reset($block->functions)($params); },
310: $mod,
311: $block->contentType,
312: "block $name"
313: );
354: $block->functions = array_merge($block->functions, $functions);
355: }
356:
357:
358: private function filter(callable $function, $mod, string $contentType, string $name): void
362: {
363: if ($mod === null || $mod === $contentType) {
364: $function();
365:
366: } elseif ($mod instanceof \Closure) {
367: echo $mod($this->capture($function), $contentType);
368:
302: ? ", did you mean '$t'?"
303: : '.';
304: $name = $layer ? "$layer $name" : $name;
305: throw new Latte\RuntimeException("Cannot include undefined block '$name'$hint");
306: }
307:
308: $this->filter(
309: function () use ($block, $params): void { reset($block->functions)($params); },
310: $mod,
311: $block->contentType,
312: "block $name"
313: );
314: }
315:
316:
| $function |
|
| $mod | 'html'
|
| $contentType | 'html'
|
| $name | 'block content'
|
433: ';
434: }
435: echo ' </div>
436: </li>
437: </ul>
438: </div>
439: </div>
440: </nav>
441:
442: ';
443: $this->renderBlock('content', [], 'html') /* line 108 */;
444: echo "\n";
445: if ($config->enableAdultModal) {
446: echo ' <div class="modal fade" id="adultModal" tabindex="-1" role="dialog" aria-labelledby="adultTitle" aria-hidden="true" data-backdrop="static" data-keyboard="false">
447: <div class="modal-dialog modal-dialog-centered" role="document">
98: <div class="dropdown-menu" aria-labelledby="navbarDropdown">
99: <a n:if="$locale === 'en'" class="dropdown-item" n:href="changeLocale! sk"><img src="/img/sk.svg" width="10px" height="10px" alt="{_app.translationLink.sk}"> {_app.translationLink.sk}</a>
100: <a n:if="$locale === 'sk'" class="dropdown-item" n:href="changeLocale! en"><img src="/img/gb.svg" width="10px" height="10px" alt="{_app.translationLink.en}"> {_app.translationLink.en}</a>
101: </div>
102: </li>
103: </ul>
104: </div>
105: </div>
106: </nav>
107:
108: {include content}
109:
110: <div n:if="$config->enableAdultModal" class="modal fade" id="adultModal" tabindex="-1" role="dialog" aria-labelledby="adultTitle" aria-hidden="true" data-backdrop="static" data-keyboard="false">
111: <div class="modal-dialog modal-dialog-centered" role="document">
112: <div class="modal-content">
| $name | 'content'
|
| $params | array (0)
|
| $mod | 'html'
|
161: public function render(?string $block = null): void
166: {
167: $level = ob_get_level();
168: try {
169: $this->prepare();
170: if (!$this->doRender($block)) {
171: $this->main();
172: }
173:
174: } catch (\Throwable $e) {
175: while (ob_get_level() > $level) {
193:
194: if ($this->referenceType === 'import') {
195: if ($this->parentName) {
196: throw new Latte\RuntimeException('Imported template cannot use {extends} or {layout}, use {import}');
197: }
198:
199: } elseif ($this->parentName) { ob_start(function () {});
201: $this->params = $this->main();
202: ob_end_clean();
203: $this->createTemplate($this->parentName, $this->params, 'extends')->render($block);
204:
205: } elseif ($block !== null) { $this->renderBlock($block, $this->params);
207:
160:
161: public function render(?string $block = null): void
166: {
167: $level = ob_get_level();
168: try {
169: $this->prepare();
170: if (!$this->doRender($block)) {
171: $this->main();
172: }
173:
174: } catch (\Throwable $e) {
92:
93: public function render(string $name, $params = [], ?string $block = null): void
98: {
99: $template = $this->createTemplate($name, $this->processParams($params));
100: $template->global->coreCaptured = false;
101: ($this->probe)($template);
102: $template->render($block);
103: }
104:
105:
106:
36: return $this->latte;
37: }
38:
39:
40: public function render(?string $file = null, array $params = []): void
44: {
45: Nette\Utils\Arrays::toObject($params, $this);
46: $this->latte->render($file ?: $this->file, $this);
47: }
48:
49:
50:
| $name | '/var/www/bitcoinzmenaren.sk/app/Presenters/templates/CryptoRates/list.latte'
|
| $params |
|
40: return $this->source;
41: }
42:
43:
44: public function send(Nette\Http\IRequest $httpRequest, Nette\Http\IResponse $httpResponse): void
48: {
49: if ($this->source instanceof Nette\Application\UI\Template) {
50: $this->source->render();
51:
52: } else {
53: echo $this->source;
54: }
161:
162: Arrays::invoke($this->onPresenter, $this, $this->presenter);
163: $response = $this->presenter->run(clone $request);
164:
165: if ($response instanceof Responses\ForwardResponse) {
166: $request = $response->getRequest();
167: goto process;
168: }
169:
170: Arrays::invoke($this->onResponse, $this, $response);
171: $response->send($this->httpRequest, $this->httpResponse);
172: }
173:
174:
175: public function processException(\Throwable $e): void
| $httpRequest |
|
| $httpResponse |
|
80: }
81:
82:
83: public function run(): void
87: {
88: try {
89: Arrays::invoke($this->onStartup, $this);
90: $this->processRequest($this->createInitialRequest());
91: Arrays::invoke($this->onShutdown, $this);
92:
93: } catch (\Throwable $e) {
94: Arrays::invoke($this->onError, $this, $e);
1: <?php
2:
3: declare(strict_types=1);
4:
5: require __DIR__ . '/../vendor/autoload.php';
6:
7: App\Bootstrap::boot()
8: ->createContainer()
9: ->getByType(Nette\Application\Application::class)
10: ->run();