From e53170d47f339ec33ce5f816a0f8632f16ed7cc4 Mon Sep 17 00:00:00 2001 From: cfmitrah Date: Thu, 31 Aug 2023 20:55:40 +0530 Subject: [PATCH] Added a examples for lucee docs --- .../01.functions/isuserinrole/_examples.md | 8 +++++++- .../01.functions/sanitizehtml/_examples.md | 8 ++++++++ .../05.objects/query/rowbyindex/_examples.md | 19 +++++++++++++++++++ .../string/sanitizehtml/_examples.md | 7 +++++++ 4 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 docs/03.reference/01.functions/sanitizehtml/_examples.md create mode 100644 docs/03.reference/05.objects/query/rowbyindex/_examples.md create mode 100644 docs/03.reference/05.objects/string/sanitizehtml/_examples.md diff --git a/docs/03.reference/01.functions/isuserinrole/_examples.md b/docs/03.reference/01.functions/isuserinrole/_examples.md index 8bd5a1748..4a6252499 100644 --- a/docs/03.reference/01.functions/isuserinrole/_examples.md +++ b/docs/03.reference/01.functions/isuserinrole/_examples.md @@ -1 +1,7 @@ -*There are currently no examples for this function.* +```lucee+trycf + + + + + +``` \ No newline at end of file diff --git a/docs/03.reference/01.functions/sanitizehtml/_examples.md b/docs/03.reference/01.functions/sanitizehtml/_examples.md new file mode 100644 index 000000000..8ba1a0a63 --- /dev/null +++ b/docs/03.reference/01.functions/sanitizehtml/_examples.md @@ -0,0 +1,8 @@ +```luceescript+trycf + html = '

HTML Forms





+

If you click the "Submit" button, the form-data will be sent to a page called "/action_page.cfm".

'; + + writeDump(var=html, label='html'); + test = SanitizeHtml(html); + writeDump(var=test, label='SanitizeHtml'); +``` \ No newline at end of file diff --git a/docs/03.reference/05.objects/query/rowbyindex/_examples.md b/docs/03.reference/05.objects/query/rowbyindex/_examples.md new file mode 100644 index 000000000..f57a6992e --- /dev/null +++ b/docs/03.reference/05.objects/query/rowbyindex/_examples.md @@ -0,0 +1,19 @@ +```lucee+trycf + + q_tag = queryNew("tag,id") + tags = getTagList(); + loop collection="#tags.cf#" item="tag" { + res = queryAddRow(q_tag); + QuerySetCell(q_tag, "tag", tag, res); + QuerySetCell(q_tag, "id", res, res); + } + + + + select * from q_tag; + + + + writeDump(q_tags_indexed.rowByIndex("tag",5)); + +``` \ No newline at end of file diff --git a/docs/03.reference/05.objects/string/sanitizehtml/_examples.md b/docs/03.reference/05.objects/string/sanitizehtml/_examples.md new file mode 100644 index 000000000..1d317d9b5 --- /dev/null +++ b/docs/03.reference/05.objects/string/sanitizehtml/_examples.md @@ -0,0 +1,7 @@ +```luceescript+trycf + html = '

HTML Forms





+

If you click the "Submit" button, the form-data will be sent to a page called "/action_page.cfm".

'; + writeDump(var=html, label='html'); + test = html.sanitizeHTML(); + writeDump(var=test, label='string.SanitizeHtml'); +``` \ No newline at end of file