Skip to content

Commit

Permalink
tests: fixed compatibility with new Latte
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Dec 3, 2015
1 parent e5df0a5 commit 34eeb89
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tests/Forms.Latte/expected/FormMacros.formContainer.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Nette\Bridges\FormsLatte\FormMacros::renderFormBegin($form = $_form = $_control[
<th>Checkboxes</th>
<td>
<?php $_formStack[] = $_form; $formContainer = $_form = $_form["cont2"] ?> <ol>
<?php $iterations = 0; foreach ($formContainer->controls AS $name => $field) { ?>
<?php %a% foreach ($formContainer->controls AS $name => $field) { ?>
<li><?php $_input = is_object($field) ? $field : $_form[$field]; echo $_input->getControl() ?></li>
<?php $iterations++; } ?> </ol>
<?php $formContainer = $_form = array_pop($_formStack) ?>
Expand All @@ -37,7 +37,7 @@ Nette\Bridges\FormsLatte\FormMacros::renderFormBegin($form = $_form = $_control[
<tr>
<th>Items</th>
<td>
<?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] ?>
<?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] ?>
<?php echo $_form["input"]->getControl() ?>

<?php $formContainer = $_form = array_pop($_formStack) ;$iterations++; } ?>
Expand Down
6 changes: 3 additions & 3 deletions tests/Forms.Latte/expected/FormMacros.forms.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
%A%
Nette\Bridges\FormsLatte\FormMacros::renderFormBegin($form = $_form = $_control["myForm"], array('id' => 'myForm', 'class'=>"ajax")) ?>

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

<?php $_input = is_object($name) ? $name : $_form[$name]; echo $_input->getControl()->addAttributes(array('title' => 'Hello', 'size' => 10)) ?>
Expand Down Expand Up @@ -47,7 +47,7 @@ Nette\Bridges\FormsLatte\FormMacros::renderFormBegin($form = $_form = $_control[



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

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


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

Expand Down

0 comments on commit 34eeb89

Please sign in to comment.