Skip to content
This repository has been archived by the owner on Aug 12, 2019. It is now read-only.

Commit

Permalink
BaseInputMacros: fixed compatibility with Nette 2.4
Browse files Browse the repository at this point in the history
  • Loading branch information
hrach committed Sep 20, 2017
1 parent 526dc3a commit 4d03208
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Bridges/Latte/Macros/BaseInputMacros.php
Expand Up @@ -44,8 +44,8 @@ public function macroLabel(MacroNode $node, PhpWriter $writer)
$name = array_shift($words);
return $writer->write(
($name[0] === '$'
? '$_input = is_object(%0.word) ? %0.word : $_form[%0.word];'
: '$_input = $_form[%0.word];'
? '$_input = is_object(%0.word) ? %0.word : end($this->global->formsStack)[%0.word];'
: '$_input = end($this->global->formsStack)[%0.word];'
) . 'if ($_label = $_input->%1.raw) echo ' . $class . '::label($_label->addAttributes(%node.array), $_input, %2.var)',
$name,
$words ? ('getLabelPart(' . implode(', ', array_map([$writer, 'formatWord'], $words)) . ')') : 'getLabel()',
Expand Down Expand Up @@ -79,8 +79,8 @@ public function macroInput(MacroNode $node, PhpWriter $writer)
$name = array_shift($words);
return $writer->write(
($name[0] === '$'
? '$_input = is_object(%0.word) ? %0.word : $_form[%0.word];'
: '$_input = $_form[%0.word];'
? '$_input = is_object(%0.word) ? %0.word : end($this->global->formsStack)[%0.word];'
: '$_input = end($this->global->formsStack)[%0.word];'
) . 'echo ' . $class . '::input($_input->%1.raw->addAttributes(%node.array), $_input, %2.var)',
$name,
$words ? 'getControlPart(' . implode(', ', array_map([$writer, 'formatWord'], $words)) . ')' : 'getControl()',
Expand Down

0 comments on commit 4d03208

Please sign in to comment.