Skip to content

Commit b65a8a0

Browse files
committed
tests: updated for last Latte
1 parent cfe069b commit b65a8a0

File tree

5 files changed

+275
-192
lines changed

5 files changed

+275
-192
lines changed

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,13 @@
2424
"nette/application": "^3.0",
2525
"nette/di": "^3.0",
2626
"nette/tester": "^2.0",
27-
"latte/latte": "^2.8",
27+
"latte/latte": "^2.9",
2828
"tracy/tracy": "^2.4",
2929
"phpstan/phpstan-nette": "^0.12"
3030
},
3131
"conflict": {
32-
"nette/di": "<3.0-stable"
32+
"nette/di": "<3.0-stable",
33+
"latte/latte": ">=3.0"
3334
},
3435
"autoload": {
3536
"classmap": ["src/"]
Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,29 @@
11
<?php
22
%A%
33
$form = $_form = $this->global->formsStack[] = $this->global->uiControl["myForm"];
4-
?><form<?php echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin(end($this->global->formsStack), [], false) ?>>
5-
<button<?php
4+
echo '<form';
5+
echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin(end($this->global->formsStack), [], false);
6+
echo '>
7+
<button';
68
$_input = end($this->global->formsStack)["send"];
7-
echo $_input->getControlPart()->attributes() ?>>
9+
echo $_input->getControlPart()->attributes();
10+
echo '>
811
description of button
912
</button>
1013
11-
<button<?php
14+
<button';
1215
$_input = end($this->global->formsStack)["send"];
13-
echo $_input->getControlPart()->attributes() ?>></button>
16+
echo $_input->getControlPart()->attributes();
17+
echo '></button>
1418
15-
<button<?php
19+
<button';
1620
$_input = end($this->global->formsStack)["send"];
17-
echo $_input->getControlPart()->attributes() ?>><?php echo htmlspecialchars($_input->getCaption()) ?></button>
18-
<?php
21+
echo $_input->getControlPart()->attributes();
22+
echo '>';
23+
echo htmlspecialchars($_input->getCaption());
24+
echo '</button>
25+
';
1926
echo Nette\Bridges\FormsLatte\Runtime::renderFormEnd(array_pop($this->global->formsStack), false);
20-
?></form>
27+
echo '</form>
28+
';
2129
%A%
Lines changed: 57 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,100 @@
11
<?php
22
%A%
3+
/* line 1 */
34
echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin($form = $_form = $this->global->formsStack[] = $this->global->uiControl["myForm"], []);
4-
?>
5-
5+
echo '
66
<table>
77
<tr>
8-
<th><?php if ($_label = end($this->global->formsStack)["input1"]->getLabel()) echo $_label ?></th>
9-
<td><?php echo end($this->global->formsStack)["input1"]->getControl() /* line 5 */ ?></td>
8+
<th>';
9+
if ($_label = end($this->global->formsStack)["input1"]->getLabel()) echo $_label;
10+
echo '</th>
11+
<td>';
12+
echo end($this->global->formsStack)["input1"]->getControl() /* line 5 */;
13+
echo '</td>
1014
</tr>
11-
<?php
15+
';
1216
$this->global->formsStack[] = $formContainer = $_form = end($this->global->formsStack)["cont1"];
13-
?>
14-
<tr>
15-
<th><?php if ($_label = end($this->global->formsStack)["input2"]->getLabel()) echo $_label ?></th>
16-
<td><?php echo end($this->global->formsStack)["input2"]->getControl() /* line 10 */ ?></td>
17+
echo ' <tr>
18+
<th>';
19+
if ($_label = end($this->global->formsStack)["input2"]->getLabel()) echo $_label;
20+
echo '</th>
21+
<td>';
22+
echo end($this->global->formsStack)["input2"]->getControl() /* line 10 */;
23+
echo '</td>
1724
</tr>
1825
<tr>
19-
<th><?php if ($_label = end($this->global->formsStack)["input3"]->getLabel()) echo $_label ?></th>
20-
<td><?php echo end($this->global->formsStack)["input3"]->getControl() /* line 14 */ ?></td>
26+
<th>';
27+
if ($_label = end($this->global->formsStack)["input3"]->getLabel()) echo $_label;
28+
echo '</th>
29+
<td>';
30+
echo end($this->global->formsStack)["input3"]->getControl() /* line 14 */;
31+
echo '</td>
2132
</tr>
2233
<tr>
2334
<th>Checkboxes</th>
2435
<td>
25-
<?php
36+
';
2637
$this->global->formsStack[] = $formContainer = $_form = end($this->global->formsStack)["cont2"];
27-
?> <ol>
28-
<?php
38+
echo ' <ol>
39+
';
2940
$iterations = 0;
3041
foreach ($formContainer->controls AS $name => $field) {
31-
?> <li><?php
42+
echo ' <li>';
3243
$_input = is_object($field) ? $field : end($this->global->formsStack)[$field];
33-
echo $_input->getControl() /* line 20 */ ?></li>
34-
<?php
44+
echo $_input->getControl() /* line 20 */;
45+
echo '</li>
46+
';
3547
$iterations++;
3648
}
37-
?> </ol>
38-
<?php
49+
echo ' </ol>
50+
';
3951
array_pop($this->global->formsStack);
40-
$formContainer = $_form = end($this->global->formsStack) ?>
41-
</td>
52+
$formContainer = $_form = end($this->global->formsStack);
53+
echo ' </td>
4254
</tr>
4355
<tr>
44-
<th><?php if ($_label = end($this->global->formsStack)["input7"]->getLabel()) echo $_label ?></th>
45-
<td><?php echo end($this->global->formsStack)["input7"]->getControl() /* line 26 */ ?></td>
56+
<th>';
57+
if ($_label = end($this->global->formsStack)["input7"]->getLabel()) echo $_label;
58+
echo '</th>
59+
<td>';
60+
echo end($this->global->formsStack)["input7"]->getControl() /* line 26 */;
61+
echo '</td>
4662
</tr>
47-
<?php
63+
';
4864
array_pop($this->global->formsStack);
4965
$formContainer = $_form = end($this->global->formsStack);
5066
$this->global->formsStack[] = $formContainer = $_form = end($this->global->formsStack)["items"];
51-
?>
52-
<tr>
67+
echo ' <tr>
5368
<th>Items</th>
5469
<td>
55-
<?php
70+
';
5671
$items = array(1, 2, 3);
5772
$iterations = 0;
5873
foreach ($items as $item) {
5974
if (!isset($formContainer[$item])) continue;
6075
$this->global->formsStack[] = $formContainer = $_form = is_object($item) ? $item : end($this->global->formsStack)[$item];
61-
?> <?php echo end($this->global->formsStack)["input"]->getControl() /* line 37 */ ?>
62-
63-
<?php
76+
echo ' ';
77+
echo end($this->global->formsStack)["input"]->getControl() /* line 37 */;
78+
echo "\n";
6479
array_pop($this->global->formsStack);
6580
$formContainer = $_form = end($this->global->formsStack);
6681
$iterations++;
6782
}
68-
?>
69-
</td>
83+
echo ' </td>
7084
</tr>
71-
<?php
85+
';
7286
array_pop($this->global->formsStack);
73-
$formContainer = $_form = end($this->global->formsStack) ?>
74-
<tr>
75-
<th><?php if ($_label = end($this->global->formsStack)["input8"]->getLabel()) echo $_label ?></th>
76-
<td><?php echo end($this->global->formsStack)["input8"]->getControl() /* line 45 */ ?></td>
87+
$formContainer = $_form = end($this->global->formsStack);
88+
echo ' <tr>
89+
<th>';
90+
if ($_label = end($this->global->formsStack)["input8"]->getLabel()) echo $_label;
91+
echo '</th>
92+
<td>';
93+
echo end($this->global->formsStack)["input8"]->getControl() /* line 45 */;
94+
echo '</td>
7795
</tr>
7896
</table>
79-
<?php
97+
';
8098
echo Nette\Bridges\FormsLatte\Runtime::renderFormEnd(array_pop($this->global->formsStack));
81-
?>
99+
echo "\n";
82100
%A%

0 commit comments

Comments
 (0)