html icon indicating copy to clipboard operation
html copied to clipboard

Add ability to set Generator as a content item.

Open yiiliveext opened this issue 4 years ago • 1 comments

$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

yiiliveext avatar Dec 14 '21 11:12 yiiliveext

Looks interesting. What do you want to achieve with it? The ability itself or performance/lower memory usage?

samdark avatar Dec 14 '21 13:12 samdark