-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added a examples for lucee docs #887
base: master
Are you sure you want to change the base?
Changes from all commits
96b70bd
c8f1f3a
a35beef
65f7097
46c5972
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,6 +1,27 @@ | ||||||
```luceescript+trycf | ||||||
enc=ESAPIEncode("html","<table>");//html | ||||||
|
||||||
enc = ESAPIEncode("html","<table>");//html | ||||||
writeDump(enc); | ||||||
enc=ESAPIEncode('url','https://download.lucee.org/?type=releases');//URL | ||||||
enc = ESAPIEncode("url",'https://download.lucee.org/?type=releases');//URL | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
writeDump(enc); | ||||||
enc = ESAPIEncode("xml","foo()"); | ||||||
writeDump(enc); | ||||||
enc = ESAPIEncode("xml_attr","foo'()"); | ||||||
writeDump(enc); | ||||||
enc = ESAPIEncode("ldap","foo'()"); | ||||||
writeDump(enc); | ||||||
enc = ESAPIEncode("javascript","foo()"); | ||||||
writeDump(enc); | ||||||
enc = ESAPIEncode("DN","foo(),foo"); | ||||||
writeDump(enc); | ||||||
``` | ||||||
|
||||||
|
||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
```lucee+trycf | ||||||
<cfoutput> | ||||||
<div style="color:#ESAPIEncode("css","red")#">Example for encodeforcss</div> | ||||||
</cfoutput> | ||||||
<cfoutput><div title="#ESAPIEncode("html_attr","<test>")#"></div></cfoutput> | ||||||
|
||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
``` |
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -1 +1,17 @@ | ||||
*There are currently no examples for this function.* | ||||
|
||||
```lucee+trycf | ||||
<cfloop list="ar_AE,ar_JO,ar_SY,hr_HR,fr_BE,es_PA,mt_MT,es_VE,bg,zh_TW,it,ko,uk,lv,da_DK,es_PR,vi_VN,en_US,sr_ME,sv_SE,es_BO,en_SG,ar_BH,pt,ar_SA,sk,ar_YE,hi_IN,ga,en_MT" index="i" delimiters=","> | ||||
<cfset oldlocale = setLocale(i)> | ||||
<cfoutput><p><b><i>#i#</i></b><br /> | ||||
#lsNumberFormat(-1234.5678, "_________")#<br /> | ||||
#lsNumberFormat(-1234.5678, "_________.___")#<br /> | ||||
#lsNumberFormat(1234.5678, "_________")#<br /> | ||||
#lsNumberFormat(1234.5678, "_________.___")#<br /> | ||||
#lsNumberFormat(1234.5678, "$_(_________.___)")#<br /> | ||||
#lsNumberFormat(-1234.5678, "$_(_________.___)")#<br /> | ||||
#lsNumberFormat(1234.5678, "+_________.___")#<br /> | ||||
#lsNumberFormat(1234.5678, "-_________.___")#<br /> | ||||
</cfoutput> | ||||
</cfloop> | ||||
|
||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
``` |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -19,7 +19,7 @@ Dump( var=people, label="people - origional query" ); | |||||
*/ | ||||||
|
||||||
//filter - older than 21 | ||||||
qryPeopleOldEnough = people.filter(function(row, rowNumber, qryData){ | ||||||
qryPeopleOldEnough = queryfilter(people,function(row, rowNumber, qryData){ | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
return DateDiff('yyyy', row.dob, Now()) > 21 | ||||||
}); | ||||||
dump(var=qryPeopleOldEnough, label='qryPeopleOldEnough - older than 21'); | ||||||
|
@@ -61,7 +61,7 @@ dump(var=qryPeopleOldEnough, label='qryPeopleOldEnough - older than 21'); | |||||
|
||||||
<cftimer type="outline" label="query.filter() with scoped variables"> | ||||||
<cfscript> | ||||||
q2 = q.filter(function(row){ | ||||||
q2 = queryfilter(q,function(row){ | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
return (arguments.row.description contains s); | ||||||
}); | ||||||
</cfscript> | ||||||
|
@@ -70,7 +70,7 @@ dump(var=qryPeopleOldEnough, label='qryPeopleOldEnough - older than 21'); | |||||
|
||||||
<cftimer type="outline" label="query.filter() without unscoped variables"> | ||||||
<cfscript> | ||||||
q3 = q.filter(function(row){ | ||||||
q3 = queryfilter(q,function(row){ | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
return (row.description contains s); | ||||||
}); | ||||||
</cfscript> | ||||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1 +1,24 @@ | ||||||
*There are currently no examples for this function.* | ||||||
###Struct map | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
```luceescript+trycf | ||||||
|
||||||
original = { | ||||||
"one": { | ||||||
1: "tahi" | ||||||
}, | ||||||
"two": { | ||||||
2: "rua" | ||||||
}, | ||||||
"three": { | ||||||
3: "toru" | ||||||
}, | ||||||
"four": { | ||||||
4: "wha" | ||||||
} | ||||||
}; | ||||||
function mapOriginal(k,v) { | ||||||
return v[ListFirst(v.keyList())]; | ||||||
} | ||||||
fixed = structMap(original,mapOriginal); | ||||||
writeDump([original, fixed]); | ||||||
``` |
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -1 +1,12 @@ | ||||||||
*There are currently no examples for this tag.* | ||||||||
###CFINSERT | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
|
||||||||
### Script syntax | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
```luceescript | ||||||||
cfinsert( datasource="myDsn", tablename="users", formFields="firstName,lastName,emailAddress" ); | ||||||||
|
||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
``` | ||||||||
### CFML syntax | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
```lucee | ||||||||
<cfinsert tablename="test" datasource="datasource1" formfields="#ffilist#"> | ||||||||
|
||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
|
||
```luceescript+trycf | ||
original = { | ||
"one": { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.