Closed fprochazka closed 10 years ago
Is there any example where is form rendered via {$control}
?
My point is that it is not a standard way to write controls. Every other control returns Html object and so should this one.
$template = new \Nette\Templating\Template();
$source = <<<LATTE
<form n:name="\$form">
<input n:name="date">
</form>
LATTE;
$template->setSource($source);
$template->setCacheStorage(new \Nette\Caching\Storages\DevNullStorage());
$template->registerFilter(new \Nette\Latte\Engine());
$template->registerHelperLoader('Nette\Templating\Helpers::loader');
$template->form = $form;
echo $template;
Fatal Error
Call to a member function attributes() on a non-object
But with your fix it will generate empty <input>
.
Heh, good point. I don't know then. But I still think it's better when it returns Html object rather than string.
:disappointed:
It is here https://github.com/nette/examples/commit/791b2a19c1bb675f697833e472d6ee85be4474be but I don't like it...
Consistency is always good!
getControl() must return HTML object so it can be rendered without
{$control|noescape}
viz http://nezmar.jabbim.cz/logs/nette@conf.netlab.cz/2014/01/09.html#21:18:22.189294