I am making a page in my Play app that talks about how to make Play app pages. (Very meta :P)
I couldn't find anything in the Play Framework documentation that explains how to escape Play's template syntax in a template. Does anyone know how to do this?
Lets say you want to display ${name}
as HTML text and not let play render a value for variable name then the answer to the question can be found when letting play compile ${"$"} in the template.
Play produces an error stating:
illegal string body character after dollar sign; solution: either escape a literal dollar sign "\$5" or bracket the value expression "${5}"
This actually means that if you want to display ${name}
you should write the following
${"\${name}"}
Try this, it works!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With