We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e97de26 commit c3ddbefCopy full SHA for c3ddbef
1 file changed
src/Forms/Container.php
@@ -282,9 +282,15 @@ public function addComponent(
282
/**
283
* Iterates over all form controls.
284
*/
285
- public function getControls(): \Iterator
+ public function getControls(): iterable
286
{
287
- return $this->getComponents(true, Control::class);
+ return Nette\Utils\Iterables::repeatable(function () {
288
+ foreach ($this->getComponentTree() as $component) {
289
+ if ($component instanceof Control) {
290
+ yield $component->getName() => $component;
291
+ }
292
293
+ });
294
}
295
296
0 commit comments