You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today I tried to make use of a scala.Option in my twirl template but found it rather hard / unelegant to use it in a nice way.
what I had to do was
@if(myOption.isDefined) {
some code @myOption.get
} else {
some alternative code
}
What I wanted was something like a map with an else block, basically this kind of code
@if(myOption) { value =>
code when my value is @value
} else {
code when my value is not present
}
Is there something like this already? If not, how would I get started in providing a PR?
Is it a good idea to enhance the "if" with this or should I focus on implementing a new thing like @ifdefined(myOption) { value => ... } else { .. } ?
The text was updated successfully, but these errors were encountered:
Today I tried to make use of a scala.Option in my twirl template but found it rather hard / unelegant to use it in a nice way.
what I had to do was
What I wanted was something like a map with an else block, basically this kind of code
Is there something like this already? If not, how would I get started in providing a PR?
Is it a good idea to enhance the "if" with this or should I focus on implementing a new thing like
@ifdefined(myOption) { value => ... } else { .. }
?The text was updated successfully, but these errors were encountered: