Object-Relational Mapping (ORM) allows you to work with objects and have them saved to the database automatically. It can greatly simplify create-read-update-delete (CRUD) operations and make your code more object-oriented. Under the hood, ColdFusion uses the industry leading ORM framework called Hibernate.
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
.DS_Store | |
WEB-INF |
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
<cfscript> | |
component output="false" { | |
public googleURL function init(apiKey) | |
description="Initialize this CFC as an object" | |
{ | |
variables.apiKey = arguments.apiKey; | |
return this; | |
} | |
public string function ShortenURL(required string url) |
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
<cfscript> | |
component output="false" { | |
public formatPhone function init(){ | |
return this; | |
} | |
public string function formatPhone(required string phoneNumber) | |
description="Strips out anything that isn't a number and then takes the first 10 digits and formats them to our spec: (404) 555-1212" | |
output="false" |
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
<cfoutput> | |
<div> | |
<form action="#$.content('url')#?keywords=#$.event('keywords')#"> | |
<dl> | |
<dt>Keywords</dt> | |
<dd><input type="text" name="keywords" value="#HTMLEditFormat($.event('keywords'))#" /></dd> | |
<dd><input type="submit" value="Search" /></dd> | |
</dl> |
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
<cfscript> | |
// Category Iterator of Children of the Current Content Node | |
itKidsCats = $.content().getKidsCategoryIterator(); | |
// Category Iterator of the CURRENT Content Node | |
itCats = $.content().getCategoriesIterator(); | |
</cfscript> | |
<cfoutput> | |
<!--- Children of the Current Content Node ---> | |
<h4>Kids Categories</h4> | |
<cfif itKidsCats.hasNext()> |
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
<cfscript> | |
param name='form.rssurl' default='http://www.npr.org/rss/rss.php?id=1014'; | |
param name='form.parentfilename' default='blog'; | |
param name='form.isSubmitted' default='false'; | |
param name='form.istest' default='true'; | |
param name='form.siteid' default='default'; | |
$ = application.serviceFactory.getBean('$').init(form.siteid); | |
if ( !$.currentUser().isSuperUser() && !$.currentUser().isInGroup('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
<cfscript> | |
param name='form.csvUrl' default='#getPageContext().getRequest().getScheme()#://#cgi.server_name##getDirectoryFromPath(getPageContext().getRequest().getRequestURI())#users.csv'; | |
param name='form.group' default='Temp'; | |
param name='form.isSubmitted' default='false'; | |
param name='form.isTest' default='true'; | |
param name='form.siteid' default='default'; | |
$ = application.serviceFactory.getBean('$').init(form.siteid); | |
if ( !$.currentUser().isSuperUser() && !$.currentUser().isInGroup('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
<!doctype html> | |
<head> | |
<title>AngularJS: ng-show and ng-hide example</title> | |
</head> | |
<body ng-app="NgHideShowApp"> | |
<div ng-controller="AppCtrl"> | |
<div> | |
<input type="checkbox" ng-model="showText">Change Text | |
<br> | |
<div ng-show="showText"> |
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
<cfscript> | |
// drop this in your eventHandler.cfc | |
public void function onSiteCKFinderConfig($) { | |
var config = arguments.$.event('config'); | |
for (var i=1; i LTE ArrayLen(config.resourceType); i++){ | |
config.resourceType[i].allowedExtensions = ListAppend(config.resourceType[i].allowedExtensions,'abc'); | |
} | |
arguments.$.event('config',config); | |
} | |
</cfscript> |
OlderNewer