html
html copied to clipboard
Add ability to set Generator as a content item.
$items = ['blue', 'green', 'red'];
echo Div::tag()->content(
'Collors',
'<br>',
(static function() use ($items): Generator
{
foreach ($items as $item) {
yield Div::tag()->content($item);
}
})()
);
See an example https://3v4l.org/brubX
Looks interesting. What do you want to achieve with it? The ability itself or performance/lower memory usage?