-
Notifications
You must be signed in to change notification settings - Fork 60
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
@foreach razor syntax #120
Comments
Contributions to vash are always welcome! I'd love to see your implementation. Did you do it by directly modifying the library, or something else? One of the main reasons why I never implemented |
Sure below you find the implementation, I'm sure its not bulletproof and optimized but I'm currently using it in a new repo and it works till now. I'm using vash as a view engine in my frontend repositories for .NET backend implementations which use Razor as view engine. And therefore the goal is on my side to keep the syntax as close to the Razor syntax as possible. The frontend repository then delivers a package which exactly contains the structure .NET needs. Tell me if your interested in looking further into the @foreach implementation, i'm sure we can optimize it and make it ready for your repo,
|
If I'm reading your example correctly, I think it's too error-prone to rely on within vash. It's effectively a preprocessor step that's doing manual parsing itself, right? I think it might break with an inline foreach. I'm going to close this, but I'll keep it in mind if I ever decide to add syntax expansion to vash. |
Hi,
First of all, thanks a lot for this great template engine.
It helps a lot to build views, completely separated from the backend.
I just wanted to raise the question why you didn't implement @foreach, as it is in the razor syntax?
If you want to add it, I have built it in an extension, I can contribute and we can optimize it together if you want?
Regards
The text was updated successfully, but these errors were encountered: