Skip to content

Commit

Permalink
Form inputs: drop Latte workaround for form context
Browse files Browse the repository at this point in the history
  • Loading branch information
mabar committed Aug 14, 2023
1 parent ba891f4 commit be52657
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/UI/Form/Latte/FormInputs.latte
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@

{if $hasBlock}
{if $input instanceof Nette\Forms\Controls\BaseControl}
{php $this->global->formsStack[] = $input->getForm(); }

{var $inputName = $input->getName()}
{var $parent = $input->getParent()}
{while $parent instanceof Nette\Forms\Container && !$parent instanceof Nette\Forms\Form}
{var $inputName = $parent->getName() . '-' . $inputName}
{do $parent = $parent->getParent()}
{/while}

{include block field-{$inputClass} $input, $inputName}
{formContext $input->getForm()}
{include block field-{$inputClass} $input, $inputName}
{/formContext}
{else}
<span>INPUT TYPE NOT SUPPORTED - HAS TO EXTEND {Nette\Forms\Controls\BaseControl::class}</span>
{/if}
Expand Down

0 comments on commit be52657

Please sign in to comment.