Skip to content

Commit 34eeb89

Browse files
committed
tests: fixed compatibility with new Latte
1 parent e5df0a5 commit 34eeb89

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Nette\Bridges\FormsLatte\FormMacros::renderFormBegin($form = $_form = $_control[
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 @@ Nette\Bridges\FormsLatte\FormMacros::renderFormBegin($form = $_form = $_control[
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

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

5-
<?php $iterations = 0; foreach (array('id', 'username', 'select', 'area', 'send') as $name) { ?>
5+
<?php %a% foreach (array('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(array('title' => 'Hello', 'size' => 10)) ?>
@@ -47,7 +47,7 @@ Nette\Bridges\FormsLatte\FormMacros::renderFormBegin($form = $_form = $_control[
4747

4848

4949

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

@@ -68,7 +68,7 @@ Nette\Bridges\FormsLatte\FormMacros::renderFormBegin($form = $_form = $_control[
6868
))->attributes() ?>> <input<?php $_input = $_form["checkbox"]; echo $_input->{method_exists($_input, 'getControlPart')?'getControlPart':'getControl'}()->attributes() ?>> </label>
6969

7070

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

0 commit comments

Comments
 (0)