Created
February 11, 2011 20:26
-
-
Save davejlong/822958 to your computer and use it in GitHub Desktop.
This is my new conventian to comment CRUD controllers in my CFCs
This file contains hidden or 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"> | |
<!---Crud #### Create methods #### ---> | |
<cffunction name="new"> | |
<cfset user = model('user').new() /> | |
</cffunction> | |
<cffunction name="create"> | |
<cfset model('user').create(params.user) /> | |
<cfset redirectTo(action="index",success="User #user.name# created successfully.") /> | |
</cffunction> | |
<!---cRud #### Read methods #### ---> | |
<cffunction name="index"> | |
<cfset users = model('user').findAll(order='name'); | |
</cffunction> | |
<!---crUd #### Update Methods #### ---> | |
<!---cruD #### Delete methods #### ---> | |
</cfcomponent> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It makes it (1) really easy to find CRUD methods in CFCs and (2) really easy to find each individual CRUD function.