My Secret Life as a Spaghetti Coder
home | about | contact | privacy statement
Model | View | Controller | Migration

cfrails.Controller
Component Controller

The base Controller class, from which all controllers should be derived.

properties:
methods: after, before, create, destroy, edit, getModelType, index, init, list, new, render, setModelType, show, update


after
public after ( String noneExcept="", String allExcept="", required string run )

Runs function run() after the list of functions in noneExcept is executed or after all functions except those in allExcept, only if using the default url/action mapper.

Output: enabled
Parameters:
   noneExcept: String, optional, noneExcept - A comma delimited list of functions that run should be run after.
   allExcept: String, optional, allExcept - A comma delimited list of functions that run should not be run after.
   run: string, required, run

before
public before ( String noneExcept="", String allExcept="", required string run )

Runs function run() before the list of functions in noneExcept is executed or before all functions except those in allExcept, only if using the default url/action mapper.

Output: enabled
Parameters:
   noneExcept: String, optional, noneExcept - A comma delimited list of functions that run should be run before.
   allExcept: String, optional, allExcept - A comma delimited list of functions that run should be run before.
   run: string, required, run

create
public create ( )

Initializes the model with the contents of the form, and saves the new record to the database. Upon success, executes after_create() method, which defaults to redirect to the list() action. Upon failure, executes after_create_failure() sending a · (alt-250) delimited list of the errors.

Output: enabled

destroy
public destroy ( )

Deletes a row from the table the model references.

Output: enabled

edit
public edit ( )

Renders and populates the form for the controller's model, and instantiates an object of the model, with all member variables initialized to the values found in the row of the id passed in url.

Output: enabled

getAfterAllButThisList
public getAfterAllButThisList ( )

This function shouldn't really be used, it may not exist later when I figure out a better way to accomplish the goal.

Output: enabled

getAfterNoneButThisList
public getAfterNoneButThisList ( )

This function shouldn't really be used, it may not exist later when I figure out a better way to accomplish the goal.

Output: enabled

getBeforeAllButThisList
public getBeforeAllButThisList ( )

This function shouldn't really be used, it may not exist later when I figure out a better way to accomplish the goal.

Output: enabled

getBeforeNoneButThisList
public getBeforeNoneButThisList ( )

This function shouldn't really be used, it may not exist later when I figure out a better way to accomplish the goal.

Output: enabled

getModelType
public getModelType ( )

Output: enabled

index
public index ( )

The default action of the controller. cfrails by default calls the list action.

Output: enabled

init
public Controller init ( )

Returns the derived Controller. Objects of type Controller cannot be instantiated (i.e., this is supposed to be an abstract class).

Output: suppressed

list
public list ( filter="" )

Lists all of the rows in the table the model refers to.

Output: enabled
Parameters:
   filter: any, optional, filter - Filters the results for the list. For instance, you might have: name like '%joe%'

new
public new ( )

Renders and populates the form for the controller's model, and instantiates an object of the model, with all member variables initialized to blank values.

Output: enabled

render
public render ( controller="[runtime expression]", required action, message="" )

Outputs the given controller/action

Output: enabled
Parameters:
   controller: any, optional, controller - The controller in which the given action to be rendered can be found. If not given, uses the current controller.
   action: any, required, action - The action whose view should be shown.
   message: any, optional, message - A message to display in the view, if it displays a message.

setModelType
public setModelType ( modelType )

Output: enabled
Parameters:
   modelType: any, optional, modelType - The full name of model type, since cfrails will be trying to instantiate it, likely from a different directory than the one in which you're calling it. For example, 'org.eclipse.cfeclipse.somepackage.somecomponent'

show
public show ( )

Output: enabled

update
public update ( )

Initializes the model with the contents of the form, and saves the new record to the database. Upon success, executes after_update() method, which defaults to redirect to the list() action. Upon failure, executes after_create_failure() sending a · (alt-250) delimited list of the errors.

Output: enabled

Google
Web CodeOdor.com

Me
Picture of me

Topics
.NET (19)
AI/Machine Learning (14)
Answers To 100 Interview Questions (10)
Bioinformatics (2)
Business (1)
C and Cplusplus (6)
cfrails (22)
ColdFusion (78)
Customer Relations (15)
Databases (3)
DRY (18)
DSLs (11)
Future Tech (5)
Games (5)
Groovy/Grails (8)
Hardware (1)
IDEs (9)
Java (38)
JavaScript (4)
Linux (2)
Lisp (1)
Mac OS (4)
Management (15)
MediaServerX (1)
Miscellany (76)
OOAD (37)
Productivity (11)
Programming (168)
Programming Quotables (9)
Rails (31)
Ruby (67)
Save Your Job (58)
scriptaGulous (4)
Software Development Process (23)
TDD (41)
TDDing xorblog (6)
Tools (5)
Web Development (8)
Windows (1)
With (1)
YAGNI (10)

Resources
Agile Manifesto & Principles
Principles Of OOD
ColdFusion
CFUnit
Ruby
Ruby on Rails
JUnit



RSS 2.0: Full Post | Short Blurb
Subscribe by email:

Delivered by FeedBurner