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
<cffunction name="filters" returntype="void" access="public" output="false" | |
hint="Tells Wheels to run a function before an action is run or after an action has been run. You can also specify multiple functions and actions." | |
examples= | |
' | |
<!--- Always execute restrictAccess before all actions in this controller ---> | |
<cfset filters("restrictAccess")> | |
<!--- Always execute isLoggedIn and checkIPAddress (in that order) before all actions in this controller except the home and login action ---> | |
<cfset filters(through="isLoggedIn,checkIPAddress", except="home,login")> | |
' |
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
<!--- cfwheels snippet | |
Description: | |
---> | |
<cfset test = "I am a snippet for Wheels" /> |
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
<cfcomponent extends="Controller" output="false"> | |
# ... | |
<cffunction name="show"> | |
<!--- Find the record ---> | |
<cfset entry = model("Entry").findByKey(params.key)> | |
# ... | |
</cffunction> | |
<cffunction name="edit"> |
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
<cfcomponent extends="Controller" output="false"> | |
<cffunction name="show"> | |
<cfset student = model("Student").findByKey(key=1, include="Enrollments") /> | |
<cfset course = model("Course").findByKey(key=2, include="Enrollments") /> | |
</cffunction> | |
</cfcomponent > |
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
<!--- on initial request, run query ---> | |
<cfset "session.#attributes.myactionfile#" = "" /> | |
<cfsavecontent variable="datasorter_js"> | |
<style type="text/css" title="currentStyle"> | |
@import "css/datatables_table.css"; | |
</style> | |
<script type="text/javascript" language="javascript" src="js/jquery.dataTables.min.js"></script> | |
<script type="text/javascript" charset="utf-8"> | |
$(document).ready(function() { |
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
<!--- | |
Let's generate our default HTML documentation on Wheels: | |
---> | |
<cfscript> | |
version = "1.0.5"; | |
wheels = createObject("component", "ColdDoc").init(); | |
strategy = createObject("component", "colddoc.strategy.api.HTMLAPIStrategy").init( | |
expandPath("docs"), | |
"ColdFusion On Wheels #version#"); |
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
<!--- place in views/say folder ---> | |
<cfoutput> | |
#javaScriptIncludeTag("jquery-1.4.2.min")# | |
</cfoutput> | |
<script language="JavaScript"> | |
// Listen to the "click" event of the "alert-button" link and make an AJAX request | |
$(document).ready(function(){$("#alert-button").click(function() { | |
$.ajax({ | |
type: "POST", |
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
<!--- place in /controllers folder---> | |
<cfcomponent extends="Controller"> | |
<cffunction name="getdemo" returntype="Query" access="private" > | |
<cfset var entries = model("entry").findAll(select="BODY,CATEGORYID,TITLE,dateCreated") /> | |
<cfreturn entries /> | |
</cffunction> | |
<cffunction name="init"> | |
<cfset filters(through="turnOffDebugging",only="processing")> |
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
<!--- | |
This will create two variables for the page too be outputted: | |
OUTPUT: | |
CAPTCHA_DISPLAY - captcha fields/image | |
CAPTCHA_ERROR - error message of captcha failure | |
blnIsBot - is this a bot | |
http://www.bennadel.com/blog/873-Using-CAPTCHA-In-ColdFusion-8.htm | |
---> |
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
<html> | |
<body> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html> | |
<head> | |
<title>ValidateThis! Demo Page</title> | |
<link href="/stylesheets/demostyle.css" media="all" rel="stylesheet" type="text/css" /> | |
<link href="/stylesheets/uni-form-styles.css" media="all" rel="stylesheet" type="text/css" /> |
OlderNewer