Skip to content

Commit

Permalink
test: fix for last Latte
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Mar 29, 2020
1 parent bfccde8 commit dd11397
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 54 deletions.
4 changes: 1 addition & 3 deletions tests/Forms.Latte/expected/FormMacros.button.phtml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<?php
%A%
$form = $_form = $this->global->formsStack[] = $this->global->uiControl["myForm"];
?><form<?php
echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin(end($this->global->formsStack), array (
), false) ?>>
?><form<?php echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin(end($this->global->formsStack), [], false) ?>>
<button<?php
$_input = end($this->global->formsStack)["send"];
echo $_input->getControlPart()->attributes() ?>>
Expand Down
65 changes: 17 additions & 48 deletions tests/Forms.Latte/expected/FormMacros.forms.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,10 @@

<LABEL title=hello<?php
$_input = end($this->global->formsStack)["username"];
echo $_input->getLabelPart()->addAttributes(array (
'title' => NULL,
))->attributes() ?>>Name</LABEL>
echo $_input->getLabelPart()->addAttributes(['title' => null])->attributes() ?>>Name</LABEL>
<input value=val type class="hello"<?php
$_input = end($this->global->formsStack)["username"];
echo $_input->getControlPart()->addAttributes(array (
'value' => NULL,
'type' => NULL,
'class' => NULL,
))->attributes() ?>>
echo $_input->getControlPart()->addAttributes(['value' => null, 'type' => null, 'class' => null])->attributes() ?>>

<label<?php
$_input = is_object($form['username']) ? $form['username'] : end($this->global->formsStack)[$form['username']];
Expand Down Expand Up @@ -104,9 +98,7 @@

<label title=hello<?php
$_input = end($this->global->formsStack)["sex"];
echo $_input->getLabelPart($key)->addAttributes(array (
'title' => NULL,
))->attributes() ?>> <input<?php
echo $_input->getLabelPart($key)->addAttributes(['title' => null])->attributes() ?>> <input<?php
$_input = end($this->global->formsStack)["sex"];
echo $_input->getControlPart($key)->attributes() ?>> </label>
<?php
Expand All @@ -120,36 +112,28 @@
echo $_input->getLabelPart()->attributes() ?>><?php echo $_input->getLabelPart()->getHtml() ?></label>
<label title="hello"<?php
$_input = end($this->global->formsStack)["sex"];
echo $_input->getLabelPart()->addAttributes(array (
'title' => NULL,
))->attributes() ?>><?php echo $_input->getLabelPart()->getHtml() ?></label>
echo $_input->getLabelPart()->addAttributes(['title' => null])->attributes() ?>><?php echo $_input->getLabelPart()->getHtml() ?></label>


<?php if ($_label = end($this->global->formsStack)["checkbox"]->getLabelPart("")) echo $_label->startTag() ?> <?php
echo end($this->global->formsStack)["checkbox"]->getControlPart("") /* line 41 */ ?> Label<?php if ($_label) echo $_label->endTag() ?>

<label title=hello<?php
$_input = end($this->global->formsStack)["checkbox"];
echo $_input->getLabelPart("")->addAttributes(array (
'title' => NULL,
))->attributes() ?>> <input<?php
echo $_input->getLabelPart("")->addAttributes(['title' => null])->attributes() ?>> <input<?php
$_input = end($this->global->formsStack)["checkbox"];
echo $_input->getControlPart("")->attributes() ?>> </label>
<label title=hello<?php
$_input = end($this->global->formsStack)["checkbox"];
echo $_input->getLabelPart()->addAttributes(array (
'title' => NULL,
))->attributes() ?>> <input<?php
echo $_input->getLabelPart()->addAttributes(['title' => null])->attributes() ?>> <input<?php
$_input = end($this->global->formsStack)["checkbox"];
echo $_input->getControlPart()->attributes() ?>> </label>
<label<?php
$_input = end($this->global->formsStack)["checkbox"];
echo $_input->getLabelPart("")->attributes() ?>><?php echo $_input->getLabelPart()->getHtml() ?></label>
<label title=hello<?php
$_input = end($this->global->formsStack)["checkbox"];
echo $_input->getLabelPart()->addAttributes(array (
'title' => NULL,
))->attributes() ?>><?php echo $_input->getLabelPart()->getHtml() ?></label>
echo $_input->getLabelPart()->addAttributes(['title' => null])->attributes() ?>><?php echo $_input->getLabelPart()->getHtml() ?></label>


<?php
Expand All @@ -164,9 +148,7 @@
$_input = end($this->global->formsStack)["checklist"];
echo $_input->getLabelPart($key)->attributes() ?>> <input title=hello<?php
$_input = end($this->global->formsStack)["checklist"];
echo $_input->getControlPart($key)->addAttributes(array (
'title' => NULL,
))->attributes() ?>> </label>
echo $_input->getControlPart($key)->addAttributes(['title' => null])->attributes() ?>> </label>
<?php
$iterations++;
}
Expand All @@ -178,19 +160,13 @@
echo $_input->getLabelPart()->attributes() ?>><?php echo $_input->getLabelPart()->getHtml() ?></label>
<label title="hello"<?php
$_input = end($this->global->formsStack)["checklist"];
echo $_input->getLabelPart()->addAttributes(array (
'title' => NULL,
))->attributes() ?>><?php echo $_input->getLabelPart()->getHtml() ?></label>
echo $_input->getLabelPart()->addAttributes(['title' => null])->attributes() ?>><?php echo $_input->getLabelPart()->getHtml() ?></label>


<?php
$form = $_form = $this->global->formsStack[] = $this->global->uiControl["myForm"];
if (1) {
?><form id="myForm" class="ajax"<?php
echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin(end($this->global->formsStack), array (
'id' => NULL,
'class' => NULL,
), false) ?>>
?><form id="myForm" class="ajax"<?php echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin(end($this->global->formsStack), ['id' => null, 'class' => null], false) ?>>
<input<?php
$_input = end($this->global->formsStack)["username"];
echo $_input->getControlPart()->attributes() ?>>
Expand All @@ -205,26 +181,21 @@
<?php
$form = $_form = $this->global->formsStack[] = $this->global->uiControl["myForm"];
?><form<?php
if ($_tmp = array_filter(['nclass'])) echo ' class="', LR\Filters::escapeHtmlAttr(implode(" ", array_unique($_tmp))), '"';
echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin(end($this->global->formsStack), array (
'class' => NULL,
), false) ?>>
echo ($_tmp = array_filter(['nclass'])) ? ' class="' . LR\Filters::escapeHtmlAttr(implode(" ", array_unique($_tmp))) . '"' : "";
echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin(end($this->global->formsStack), ['class' => null], false) ?>>
<input<?php
$_input = end($this->global->formsStack)["username"];
echo $_input->getControlPart()->addAttributes(array (
'class' => NULL,
))->attributes();
if ($_tmp = array_filter(['nclass'])) echo ' class="', LR\Filters::escapeHtmlAttr(implode(" ", array_unique($_tmp))), '"' ?>>
echo $_input->getControlPart()->addAttributes(['class' => null])->attributes();
echo ($_tmp = array_filter(['nclass'])) ? ' class="' . LR\Filters::escapeHtmlAttr(implode(" ", array_unique($_tmp))) . '"' : "";
?>>
<?php
echo Nette\Bridges\FormsLatte\Runtime::renderFormEnd(array_pop($this->global->formsStack), false);
?></form>


<?php
$form = $_form = $this->global->formsStack[] = is_object($this->global->uiControl['myForm']) ? $this->global->uiControl['myForm'] : $this->global->uiControl[$this->global->uiControl['myForm']];
?><FORM<?php
echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin(end($this->global->formsStack), array (
), false) ?>>
?><FORM<?php echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin(end($this->global->formsStack), [], false) ?>>
<input<?php
$_input = end($this->global->formsStack)["username"];
echo $_input->getControlPart()->attributes() ?>>
Expand All @@ -240,9 +211,7 @@

<textarea title="<?php echo LR\Filters::escapeHtmlAttr(10) /* line 76 */ ?>"<?php
$_input = end($this->global->formsStack)["area"];
echo $_input->getControlPart()->addAttributes(array (
'title' => NULL,
))->attributes() ?>><?php echo $_input->getControl()->getHtml() ?></textarea>
echo $_input->getControlPart()->addAttributes(['title' => null])->attributes() ?>><?php echo $_input->getControl()->getHtml() ?></textarea>


<select<?php
Expand Down
4 changes: 1 addition & 3 deletions tests/Forms.Latte/expected/FormMacros.get.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@

<?php
$form = $_form = $this->global->formsStack[] = $this->global->uiControl["myForm"];
?><form<?php
echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin(end($this->global->formsStack), array (
), false) ?>>
?><form<?php echo Nette\Bridges\FormsLatte\Runtime::renderFormBegin(end($this->global->formsStack), [], false) ?>>
<?php
echo Nette\Bridges\FormsLatte\Runtime::renderFormEnd(array_pop($this->global->formsStack), false);
?></form>
Expand Down

0 comments on commit dd11397

Please sign in to comment.