Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!---
- This file is part of muraFW1
- (c) Stephen J. Withington, Jr. | www.stephenwithington.com
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
- Document: /public/controllers/main.cfc
- Author: Steve Withington | www.stephenwithington.com
- --->
- <cfcomponent extends="controller" output="false">
- <!--- ********************************* PAGES ******************************************* --->
- <cffunction name="default" output="false" returntype="any">
- <cfargument name="rc" required="true" />
- <cfdump var="#rc#" label="am i here?"><cfabort>
- </cffunction>
- <cffunction name="handleForm" output="false" returntype="any">
- <cfargument name="rc" required="true" />
- <cfdump var="#rc#" label="in handleForm" expand="false">
- <cfif structKeyExists(arguments.rc, "formId") >
- <cfinvoke
- method = "handleForm_#arguments.rc.formId#"
- rc = "#rc#"
- />
- </cfif>
- </cffunction>
- <cffunction name="handleForm_fake_1" output="false" returntype="any">
- <cfargument name="rc" required="true" />
- <cfdump var="#rc#" label="in fake_1" expand="false">
- <cfscript>
- variables.fw.service( "name.saveFirstName", "data" );
- </cfscript>
- <cfdump var="#rc#" label="rc" expand="false" abort="true" />
- <cfscript>
- if ( not data.success ) {
- arguments.rc.errors = data.errors;
- fw.redirect(action="public:example.form1", preserve="all");
- } else {
- fw.redirect(action="public:example.form2", preserve="all");
- }
- </cfscript>
- </cffunction>
- <cffunction name="handleForm_fake_2" output="false" returntype="any">
- <cfargument name="rc" required="true" />
- <cfscript>
- if (len(trim(rc.lastname)) is 0) {
- arguments.rc.errors = {};
- arguments.rc.errors.lastName = "Required.";
- fw.redirect(action="public:example.form2", preserve="all");
- } else {
- fw.redirect(action="public:example.thanks", preserve="all");
- }
- </cfscript>
- </cffunction>
- </cfcomponent>
Advertisement
Add Comment
Please, Sign In to add comment