Skip to content

Commit 99ca00b

Browse files
committed
requires Latte 3.1
1 parent 3e5ed5f commit 99ca00b

File tree

6 files changed

+141
-138
lines changed

6 files changed

+141
-138
lines changed

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@
2424
"nette/application": "^3.3",
2525
"nette/di": "^3.2",
2626
"nette/tester": "^2.5.2",
27-
"latte/latte": "^3.0.12",
27+
"latte/latte": "^3.1",
2828
"tracy/tracy": "^2.11",
2929
"phpstan/phpstan-nette": "^2.0@stable"
3030
},
3131
"conflict": {
32-
"latte/latte": "<3.0.12 || >=3.2"
32+
"latte/latte": "<3.1 || >=3.2"
3333
},
3434
"suggest": {
3535
"ext-intl": "to use date/time controls"

tests/Forms.Latte/expected/forms.button.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
<?php
22
%A%
3-
$form = $this->global->formsStack[] = $this->global->uiControl['myForm'] /* %a% */;
3+
$form = $this->global->formsStack[] = $this->global->uiControl['myForm'] /* pos 1:7 */;
44
Nette\Bridges\FormsLatte\Runtime::initializeForm($form);
55
echo '<form';
6-
echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin(end($this->global->formsStack), [], false) /* %a% */;
6+
echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin(end($this->global->formsStack), [], false) /* pos 1:7 */;
77
echo '>
88
<button';
9-
echo ($ʟ_elem = Nette\Bridges\FormsLatte\Runtime::item('send', $this->global)->getControlPart())->attributes() /* %a% */;
9+
echo ($ʟ_elem = Nette\Bridges\FormsLatte\Runtime::item('send', $this->global)->getControlPart())->attributes() /* pos 2:10 */;
1010
echo '>
1111
description of button
1212
</button>
1313
1414
<button';
15-
echo ($ʟ_elem = Nette\Bridges\FormsLatte\Runtime::item('send', $this->global)->getControlPart())->attributes() /* %a% */;
15+
echo ($ʟ_elem = Nette\Bridges\FormsLatte\Runtime::item('send', $this->global)->getControlPart())->attributes() /* pos 6:10 */;
1616
echo '></button>
1717
1818
<button';
19-
echo ($ʟ_elem = Nette\Bridges\FormsLatte\Runtime::item('send', $this->global)->getControlPart())->attributes() /* %a% */;
19+
echo ($ʟ_elem = Nette\Bridges\FormsLatte\Runtime::item('send', $this->global)->getControlPart())->attributes() /* pos 8:10 */;
2020
echo '>';
21-
echo LR\%a%::escape%a%($ʟ_elem->value) /* %a% */;
21+
echo LR\HtmlHelpers::escapeText($ʟ_elem->value) /* pos 8:10 */;
2222
echo '</button>
2323
';
24-
echo Nette\Bridges\FormsLatte\Runtime::renderFormEnd(end($this->global->formsStack), false) /* %a% */;
24+
echo Nette\Bridges\FormsLatte\Runtime::renderFormEnd(end($this->global->formsStack), false) /* pos 1:7 */;
2525
echo '</form>
2626
';
2727
array_pop($this->global->formsStack);
Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,46 @@
11
<?php
22
%A%
3-
$form = $this->global->formsStack[] = $this->global->uiControl['myForm'] /* %a% */;
3+
$form = $this->global->formsStack[] = $this->global->uiControl['myForm'] /* pos %d%:1 */;
44
Nette\Bridges\FormsLatte\Runtime::initializeForm($form);
5-
echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin($form, []) /* %a% */;
5+
echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin($form, []) /* pos %d%:1 */;
66
echo '
77
<table>
88
<tr>
99
<th>';
10-
echo ($ʟ_label = Nette\Bridges\FormsLatte\Runtime::item('input1', $this->global)->getLabel()) /* %a% */;
10+
echo ($ʟ_label = Nette\Bridges\FormsLatte\Runtime::item('input1', $this->global)->getLabel()) /* pos %d%:7 */;
1111
echo '</th>
1212
<td>';
13-
echo Nette\Bridges\FormsLatte\Runtime::item('input1', $this->global)->getControl() /* %a% */;
13+
echo Nette\Bridges\FormsLatte\Runtime::item('input1', $this->global)->getControl() /* pos %d%:7 */;
1414
echo '</td>
1515
</tr>
1616
';
17-
$this->global->formsStack[] = $formContainer = Nette\Bridges\FormsLatte\Runtime::item('cont1', $this->global) /* %a% */;
17+
$this->global->formsStack[] = $formContainer = Nette\Bridges\FormsLatte\Runtime::item('cont1', $this->global) /* pos %d%:2 */;
1818
echo ' <tr>
1919
<th>';
20-
echo ($ʟ_label = Nette\Bridges\FormsLatte\Runtime::item('input2', $this->global)->getLabel()) /* %a% */;
20+
echo ($ʟ_label = Nette\Bridges\FormsLatte\Runtime::item('input2', $this->global)->getLabel()) /* pos %d%:7 */;
2121
echo '</th>
2222
<td>';
23-
echo Nette\Bridges\FormsLatte\Runtime::item('input2', $this->global)->getControl() /* %a% */;
23+
echo Nette\Bridges\FormsLatte\Runtime::item('input2', $this->global)->getControl() /* pos %d%:7 */;
2424
echo '</td>
2525
</tr>
2626
<tr>
2727
<th>';
28-
echo ($ʟ_label = Nette\Bridges\FormsLatte\Runtime::item('input3', $this->global)->getLabel()) /* %a% */;
28+
echo ($ʟ_label = Nette\Bridges\FormsLatte\Runtime::item('input3', $this->global)->getLabel()) /* pos %d%:7 */;
2929
echo '</th>
3030
<td>';
31-
echo Nette\Bridges\FormsLatte\Runtime::item('input3', $this->global)->getControl() /* %a% */;
31+
echo Nette\Bridges\FormsLatte\Runtime::item('input3', $this->global)->getControl() /* pos %d%:7 */;
3232
echo '</td>
3333
</tr>
3434
<tr>
3535
<th>Checkboxes</th>
3636
<td>
3737
';
38-
$this->global->formsStack[] = $formContainer = Nette\Bridges\FormsLatte\Runtime::item('cont2', $this->global) /* %a% */;
38+
$this->global->formsStack[] = $formContainer = Nette\Bridges\FormsLatte\Runtime::item('cont2', $this->global) /* pos %d%:8 */;
3939
echo ' <ol>
4040
';
41-
foreach ($formContainer->controls as $name => $field) /* %a% */ {
41+
foreach ($formContainer->controls as $name => $field) /* pos %d%:32 */ {
4242
echo ' <li>';
43-
echo Nette\Bridges\FormsLatte\Runtime::item($field, $this->global)->getControl() /* %a% */;
43+
echo Nette\Bridges\FormsLatte\Runtime::item($field, $this->global)->getControl() /* pos %d%:9 */;
4444
echo '</li>
4545
';
4646

@@ -55,27 +55,27 @@
5555
</tr>
5656
<tr>
5757
<th>';
58-
echo ($ʟ_label = Nette\Bridges\FormsLatte\Runtime::item('input7', $this->global)->getLabel()) /* %a% */;
58+
echo ($ʟ_label = Nette\Bridges\FormsLatte\Runtime::item('input7', $this->global)->getLabel()) /* pos %d%:7 */;
5959
echo '</th>
6060
<td>';
61-
echo Nette\Bridges\FormsLatte\Runtime::item('input7', $this->global)->getControl() /* %a% */;
61+
echo Nette\Bridges\FormsLatte\Runtime::item('input7', $this->global)->getControl() /* pos %d%:7 */;
6262
echo '</td>
6363
</tr>
6464
';
6565
array_pop($this->global->formsStack);
6666
$formContainer = end($this->global->formsStack);
6767

68-
$this->global->formsStack[] = $formContainer = Nette\Bridges\FormsLatte\Runtime::item('items', $this->global) /* %a% */;
68+
$this->global->formsStack[] = $formContainer = Nette\Bridges\FormsLatte\Runtime::item('items', $this->global) /* pos %d%:2 */;
6969
echo ' <tr>
7070
<th>Items</th>
7171
<td>
7272
';
73-
$items = [1, 2, 3] /* %a% */;
74-
foreach ($items as $item) /* %a% */ {
75-
if (!isset($formContainer[$item])) /* %a% */ continue;
76-
$this->global->formsStack[] = $formContainer = Nette\Bridges\FormsLatte\Runtime::item($item, $this->global) /* %a% */;
73+
$items = [1, 2, 3] /* pos %d%:3 */;
74+
foreach ($items as $item) /* pos %d%:3 */ {
75+
if (!isset($formContainer[$item])) /* pos %d%:4 */ continue;
76+
$this->global->formsStack[] = $formContainer = Nette\Bridges\FormsLatte\Runtime::item($item, $this->global) /* pos %d%:4 */;
7777
echo ' ';
78-
echo Nette\Bridges\FormsLatte\Runtime::item('input', $this->global)->getControl() /* %a% */;
78+
echo Nette\Bridges\FormsLatte\Runtime::item('input', $this->global)->getControl() /* pos %d%:5 */;
7979
echo "\n";
8080
array_pop($this->global->formsStack);
8181
$formContainer = end($this->global->formsStack);
@@ -91,13 +91,13 @@
9191

9292
echo ' <tr>
9393
<th>';
94-
echo ($ʟ_label = Nette\Bridges\FormsLatte\Runtime::item('input8', $this->global)->getLabel()) /* %a% */;
94+
echo ($ʟ_label = Nette\Bridges\FormsLatte\Runtime::item('input8', $this->global)->getLabel()) /* pos %d%:7 */;
9595
echo '</th>
9696
<td>';
97-
echo Nette\Bridges\FormsLatte\Runtime::item('input8', $this->global)->getControl() /* %a% */;
97+
echo Nette\Bridges\FormsLatte\Runtime::item('input8', $this->global)->getControl() /* pos %d%:7 */;
9898
echo '</td>
9999
</tr>
100100
</table>
101101
';
102-
echo Nette\Bridges\FormsLatte\Runtime::renderFormEnd(array_pop($this->global->formsStack)) /* %a% */;
102+
echo Nette\Bridges\FormsLatte\Runtime::renderFormEnd(array_pop($this->global->formsStack)) /* pos %d%:1 */;
103103
%A%

tests/Forms.Latte/expected/forms.get.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
<?php
22
%A%
3-
$form = $this->global->formsStack[] = $this->global->uiControl['myForm'] /* %a% */;
3+
$form = $this->global->formsStack[] = $this->global->uiControl['myForm'] /* pos 1:1 */;
44
Nette\Bridges\FormsLatte\Runtime::initializeForm($form);
5-
echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin($form, []) /* %a% */;
6-
echo Nette\Bridges\FormsLatte\Runtime::renderFormEnd(array_pop($this->global->formsStack)) /* %a% */;
5+
echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin($form, []) /* pos 1:1 */;
6+
echo Nette\Bridges\FormsLatte\Runtime::renderFormEnd(array_pop($this->global->formsStack)) /* pos 1:1 */;
77

88
echo '
99
1010
';
11-
$form = $this->global->formsStack[] = $this->global->uiControl['myForm'] /* %a% */;
11+
$form = $this->global->formsStack[] = $this->global->uiControl['myForm'] /* pos 3:7 */;
1212
Nette\Bridges\FormsLatte\Runtime::initializeForm($form);
1313
echo '<form';
14-
echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin(end($this->global->formsStack), [], false) /* %a% */;
14+
echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin(end($this->global->formsStack), [], false) /* pos 3:7 */;
1515
echo '>
1616
';
17-
echo Nette\Bridges\FormsLatte\Runtime::renderFormEnd(end($this->global->formsStack), false) /* %a% */;
17+
echo Nette\Bridges\FormsLatte\Runtime::renderFormEnd(end($this->global->formsStack), false) /* pos 3:7 */;
1818
echo '</form>
1919
';
2020
array_pop($this->global->formsStack);

0 commit comments

Comments
 (0)