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

Implement foreach attribute parser #32

Open
askonomm opened this issue Nov 8, 2024 · 1 comment
Open

Implement foreach attribute parser #32

askonomm opened this issue Nov 8, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@askonomm
Copy link
Owner

askonomm commented Nov 8, 2024

It would be what the ForAttributeParser already is, except it would allow expression modifiers and keys/indexes. Ultimately this would replace the for attribute in some future release where I feel like breaking backwards compatibility.

A simple example:

<div data-htmt-foreach="posts as post">
    ...
</div>

With key/index:

<div data-htmt-foreach="posts as key, post">
    ...
</div>

And with modifiers:

<div data-htmt-foreach="posts | reversed as key, post">
    ...
</div>
@askonomm askonomm added the enhancement New feature or request label Nov 8, 2024
@askonomm
Copy link
Owner Author

askonomm commented Nov 8, 2024

Also would be nice to add more expression modifiers that are specifically meant for IEnumerable types such as offset, limit, filter, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant