root / framework / trunk / extensions / lexicon / cf / abort.cfm

Revision 223, 0.9 kB (checked in by scorfield, 3 years ago)

Addresses #93 by updating skeleton verbs with authors as appropriate and READMEs with known issues and caveats.

Line 
1<cfscript>
2        // Author: Nathan Strutz (strutz@gmail.com)
3        // example custom verb that compiles to a <cfabort> tag
4        // usage:
5        // 1. add the lexicon declaration to your circuit file:
6        //    <circuit xmlns:cf="cf/">
7        // 2. use the verb in a fuseaction:
8        //    <cf:abort/>
9        //    <cf:abort showerror="custom error message"/>
10        //
11        // how this works:
12        // a. validate the attributes passed in (fb_.verbInfo.attributes)
13        // b. in start mode, generate the required CFML
14        // c. in end mode, do nothing (this tag does not nest)
15        //
16        if (fb_.verbInfo.executionMode is "start") {
17                //
18                // showerror is optional, create the text to generate:
19                if (structKeyExists(fb_.verbInfo.attributes,"showerror")) {
20                        fb_.showerror = ' showerror="#fb_.verbInfo.attributes.showerror#"';
21                } else {
22                        fb_.showerror = '';
23                }
24                //
25                // start mode:
26                fb_appendLine('<cfabort#fb_.showerror#>');
27        } else {
28                //
29                // end mode - do nothing
30        }
31</cfscript>
Note: See TracBrowser for help on using the browser.