-
Notifications
You must be signed in to change notification settings - Fork 285
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1404 from MitrahSoft/Added_a_examples_31-08-23
Added a examples for lucee docs
- Loading branch information
Showing
4 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
*There are currently no examples for this function.* | ||
```lucee+trycf | ||
<cflogin> | ||
<cfloginuser name = "test" password = "password" roles = "user,admin,editor"> | ||
</cflogin> | ||
<cfdump var="#IsUserInRole(role_name="admin")#" /> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
```luceescript+trycf | ||
html = '<!DOCTYPE html><html><body><h2>HTML Forms</h2><form action="/action_page.cfm"><label for="fname">First name:</label><br><input type="text" id="fname" name="fname"value="Pothys"><br><br><br><input type="submit" value="Submit"> | ||
</form><p>If you click the "Submit" button, the form-data will be sent to a page called "/action_page.cfm".</p></body></html>'; | ||
writeDump(var=html, label='html'); | ||
test = SanitizeHtml(html); | ||
writeDump(var=test, label='SanitizeHtml'); | ||
``` |
19 changes: 19 additions & 0 deletions
19
docs/03.reference/05.objects/query/rowbyindex/_examples.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
```lucee+trycf | ||
<cfscript> | ||
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); | ||
} | ||
</cfscript> | ||
<cfquery name="q_tags_indexed" indexName="tag" dbtype="query"> | ||
select * from q_tag; | ||
</cfquery> | ||
<cfscript> | ||
writeDump(q_tags_indexed.rowByIndex("tag",5)); | ||
</cfscript> | ||
``` |
7 changes: 7 additions & 0 deletions
7
docs/03.reference/05.objects/string/sanitizehtml/_examples.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
```luceescript+trycf | ||
html = '<!DOCTYPE html><html><body><h2>HTML Forms</h2><form action="/action_page.cfm"><label for="fname">First name:</label><br><input type="text" id="fname" name="fname"value="Pothys"><br><br><br><input type="submit" value="Submit"> | ||
</form><p>If you click the "Submit" button, the form-data will be sent to a page called "/action_page.cfm".</p></body></html>'; | ||
writeDump(var=html, label='html'); | ||
test = html.sanitizeHTML(); | ||
writeDump(var=test, label='string.SanitizeHtml'); | ||
``` |