Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to set Generator as a content item. #99

Open
yiiliveext opened this issue Dec 14, 2021 · 1 comment
Open

Add ability to set Generator as a content item. #99

yiiliveext opened this issue Dec 14, 2021 · 1 comment

Comments

@yiiliveext
Copy link

$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

@vjik vjik added this to the 5.0.0 milestone Dec 14, 2021
@samdark
Copy link
Member

samdark commented Dec 14, 2021

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

@vjik vjik removed this from the 3.0.0 milestone Oct 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants