-
Notifications
You must be signed in to change notification settings - Fork 0
rife.render.EncodeUrl
Erik C. Thauvin edited this page Mar 28, 2023
·
3 revisions
URL-encodes a template value.
<!--v render:rife.render.EncodeUrl:valueId/-->
{{v render:rife.render.EncodeUrl:valueId/}}
Template
<a href="https://example.com/search?q={{v render:rife.render.EncodeUrl:query/}}"><!--v query/--></a>
Code
template.setValue("query", "books & movies");
Output
<a href="https://example.com/search?q=books%20%26%20movies">books & movies</a>
By default, the rendered data is raw, not template encoded. If you need additional encoding, use the encoding
property.
For example, to encode the rendered data to HTML:
{{v render:rife.render.EncodeUrl:valueId}}
encoding=html
{{/v}}
The supported additional encoding types are:
html
js
json
unicode
url
xml