Created
December 16, 2010 18:31
-
-
Save mhayes/743773 to your computer and use it in GitHub Desktop.
Creates image tag that contains QR Code
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
component output="no" name="qr" { | |
function encode(required string message) { | |
var url = "http://chart.apis.google.com/chart"; | |
url &= "?cht=qr&chs=200x200"; | |
url &= "&chl=#message#"; | |
return image_tag(url,200,200,message); | |
} | |
function image_tag(url,w,h,alt) { | |
return '<img src="#url#" width="#w#" height="#h#" alt="#alt#" />'; | |
} | |
} |
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
<h1>QR Code Demo</h1> | |
<cfset qr = new qr() /> | |
<cfoutput> | |
#qr.encode("http://cdpr.ca.gov")# | |
</cfoutput> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment