-
-
Notifications
You must be signed in to change notification settings - Fork 28
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
Can we use If Else block in Dynamic Html? (To do: include it in Documentation) #59
Comments
Certainly you can. HtmlFlow is unopinionated and provides you several ways of doing it. Btw you can do it both in Dynamic and Static HTML. You may find many examples of different kinds of use in Pet Clinic sample application in For instance, in .button().attrClass("btn btn-default").attrType(EnumTypeButtonType.SUBMIT)
.dynamic(bt -> {
if(owner == null) bt.text("Add Owner");
else bt.text("Update Owner");
})
.__() //button Simply put, The main difference between I hope it helps. |
This should be added to the documentation. I had to look through many issues before I found this answer. |
Thanks @volgin your feedback is important. Unfortunately I am overwhelmed and planning to enhance documentation for more than on year. But I did not have time yet. I have a lot of information spread on different articles, issues, README, wiki... I will reopen this Issue to remember that I should include some patterns and idioms in HtmlFlow documentation. BTW this paper https://gamboa.pt/img/my-papers/lnbip2020-unopinionated-templates.pdf put side by side some templating idioms between Thymeleaf and HtmlFlow. Maybe it could give a help in other issues. |
I included the most common use cases for data binding, if/else, and loops usage, in GitHub README. Also in https://htmlflow.org/features I have included the same examples implemented with both approaches: |
I am using HTML Flow in our project at Zinfinity, can you please tell me if we can use If Else block in HTML ?
The text was updated successfully, but these errors were encountered: