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 4f69a13 commit 45902ebCopy full SHA for 45902eb
2 files changed
composer.json
@@ -18,7 +18,7 @@
18
"php": "8.2 - 8.5",
19
"nette/component-model": "^3.2",
20
"nette/http": "^3.3",
21
- "nette/utils": "^4.0.4"
+ "nette/utils": "^4.0.10"
22
},
23
"require-dev": {
24
"nette/application": "^3.3",
src/Forms/Container.php
@@ -287,9 +287,15 @@ public function addComponent(
287
/**
288
* Iterates over all form controls.
289
*/
290
- public function getControls(): \Iterator
+ public function getControls(): iterable
291
{
292
- return $this->getComponents(true, Control::class);
+ return Nette\Utils\Iterables::repeatable(function () {
293
+ foreach ($this->getComponentTree() as $component) {
294
+ if ($component instanceof Control) {
295
+ yield $component->getName() => $component;
296
+ }
297
298
+ });
299
}
300
301
0 commit comments