Skip to content

Commit 70e0b5f

Browse files
committed
tests: fixed compatibility with new Latte
1 parent 34dc0da commit 70e0b5f

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

tests/Forms.Latte/expected/FormMacros.formContainer.phtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin($form = $_form = $_contro
2323
<th>Checkboxes</th>
2424
<td>
2525
<?php $_formStack[] = $_form; $formContainer = $_form = $_form["cont2"] ?> <ol>
26-
<?php $iterations = 0; foreach ($formContainer->controls AS $name => $field) { ?>
26+
<?php %a% foreach ($formContainer->controls AS $name => $field) { ?>
2727
<li><?php $_input = is_object($field) ? $field : $_form[$field]; echo $_input->getControl() ?></li>
2828
<?php $iterations++; } ?> </ol>
2929
<?php $formContainer = $_form = array_pop($_formStack) ?>
@@ -37,7 +37,7 @@ echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin($form = $_form = $_contro
3737
<tr>
3838
<th>Items</th>
3939
<td>
40-
<?php $items = array(1, 2, 3) ;$iterations = 0; foreach ($items as $item) { if (!isset($formContainer[$item])) continue ;$_formStack[] = $_form; $formContainer = $_form = is_object($item) ? $item : $_form[$item] ?>
40+
<?php $items = array(1, 2, 3) ;%a% foreach ($items as $item) { if (!isset($formContainer[$item])) continue ;$_formStack[] = $_form; $formContainer = $_form = is_object($item) ? $item : $_form[$item] ?>
4141
<?php echo $_form["input"]->getControl() ?>
4242

4343
<?php $formContainer = $_form = array_pop($_formStack) ;$iterations++; } ?>

tests/Forms.Latte/expected/FormMacros.forms.phtml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
%A%
33
echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin($form = $_form = $_control["myForm"], ['id' => 'myForm', 'class'=>"ajax"]) ?>
44

5-
<?php $iterations = 0; foreach (['id', 'username', 'select', 'area', 'send'] as $name) { ?>
5+
<?php %a% foreach (['id', 'username', 'select', 'area', 'send'] as $name) { ?>
66
<?php $_input = is_object($name) ? $name : $_form[$name]; if ($_label = $_input->getLabel()) echo $_label ?>
77

88
<?php $_input = is_object($name) ? $name : $_form[$name]; echo $_input->getControl()->addAttributes(['title' => 'Hello', 'size' => 10]) ?>
@@ -49,7 +49,7 @@ echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin($form = $_form = $_contro
4949

5050

5151

52-
<?php $iterations = 0; foreach ($form['sex']->items as $key => $label) { ?>
52+
<?php %a% foreach ($form['sex']->items as $key => $label) { ?>
5353
<?php if ($_label = $_form["sex"]->getLabelPart($key)) echo $_label->startTag() ?>
5454
<?php echo $_form["sex"]->getControlPart($key) ?> <?php echo Latte\Runtime\Filters::escapeHtml($label, ENT_NOQUOTES) ;if ($_label) echo $_label->endTag() ?>
5555

@@ -81,7 +81,7 @@ echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin($form = $_form = $_contro
8181
))->attributes() ?>><?php echo $_input->{method_exists($_input, 'getLabelPart')?'getLabelPart':'getLabel'}()->getHtml() ?></label>
8282

8383

84-
<?php $iterations = 0; foreach ($form['checklist']->items as $key => $label) { ?>
84+
<?php %a% foreach ($form['checklist']->items as $key => $label) { ?>
8585
<?php if ($_label = $_form["checklist"]->getLabelPart($key)) echo $_label->startTag() ?>
8686
<?php echo $_form["checklist"]->getControlPart($key) ?> <?php echo Latte\Runtime\Filters::escapeHtml($label, ENT_NOQUOTES) ;if ($_label) echo $_label->endTag() ?>
8787

0 commit comments

Comments
 (0)