-
-
Notifications
You must be signed in to change notification settings - Fork 111
Closed
Description
Version: 2.5.2
Works in 2.5.1
{define container $val, $options}
{var $options = $options ?: new App\UI\Options()}
<div n:tag-if="$options->getColumns()" class="row">
{foreach $val as $ctrl}
<div n:tag-if="$options->getColumns()" n:class="$options->getColumnClass()">
{if $ctrl instanceof Nette\Forms\Container}
{include container $ctrl->getComponents(), $ctrl->getOptions()}
{else}
{dump $ctrl}
{include controlContainer $ctrl}
{/if}
</div>
{/foreach}
</div>
{/define}
{define controlContainer $val}
{dump $val}
<div n:if="!$val->getOption(rendered) && $val->getOption(type) !== hidden"
n:class="form-group, $val->required ? required, $val->error ? has-error"
n:attr="id => $val->getOption(id)">
{if $val->getOption(type) === file}
{php $val->getControlPrototype()->addClass('ctrl-inline')}
{include control $val}
{elseif $val->getOption(type) === radio}
{include radio $val}
{elseif $val->getOption(type) === checkbox}
{include checkbox $val}
{else}
{include control $val}
{/if}
</div>
{/define}First dump is WebChemistry\Images\Controls\UploadControl (in container), second dump is Nette\ComponentModel\RecursiveComponentIterator (in controlContainer)
Error: Call to undefined method Nette\ComponentModel\RecursiveComponentIterator::getOption()
EDIT
When I dump this latte code:
Tracy\Debugger::barDump(($ctrl), '$ctrl');
bdump([$ctrl] + get_defined_vars());
$this->renderBlock('controlContainer', [$ctrl] + get_defined_vars(), 'html');Metadata
Metadata
Assignees
Labels
No labels