-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathCFWheels copy.xml
113 lines (85 loc) · 5.72 KB
/
CFWheels copy.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<?xml version="1.0" encoding="UTF-8"?>
<d:dictionary xmlns="http://www.w3.org/1999/xhtml" xmlns:d="http://www.apple.com/DTDs/DictionaryService-1.0.rng">
<d:entry id="cfwheels_application" d:title="CFWheels">
<d:index d:value="CFWheels"/>
<span class="picture">
<img src="Images/dictionary.png" alt="CFWheels (http://cfwheels.org)" class="floatright"/>
</span>
<p>CFWheels (ColdFusion on Wheels) is an open-source ColdFusion (CFML) framework inspired by Ruby on Rails.</p>
<p>
It provides fast application development, a great organization system for code, and is just plain fun to use.
</p>
<p>
To find out more, go to http://cfwheels.org/
</p>
</d:entry>
<d:entry id="addroute" d:title="addRoute" d:parental-control="1">
<d:index d:value="addRoute()"/>
<span class="picture">
<img src="Images/dictionary.png" alt="CFWheels (http://cfwheels.org)" class="floatright"/>
</span>
<h1><code>addRoute()</code></h1>
<h2>Description</h2>
<p> Adds a new route to your application.</p>
<h2>Function Syntax</h2>
<p><code><span class="pre">addRoute(<em>pattern</em> [, <em>name</em>, <em>controller</em>, <em>action</em> ])</span></code></p>
<h2>Parameters</h2>
<table>
<thead>
<tr>
<th>Parameter</th>
<th>Type</th>
<th>Required</th>
<th>Default</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr >
<td valign="top"><code>name</code></td>
<td valign="top"><code>string</code></td>
<td valign="top" class="required">No</td>
<td valign="top"><code></code></td>
<td valign="top"> Name for the route. This is referenced as the <code>name</code> argument in functions based on <a href="/docs/1-1/function/urlfor"><code>URLFor()</code></a> like <a href="/docs/1-1/function/linkto"><code>linkTo()</code></a>, <a href="/docs/1-1/function/startformtag"><code>startFormTag()</code></a>, etc.</td>
</tr>
<tr class="highlight">
<td valign="top"><code>pattern</code></td>
<td valign="top"><code>string</code></td>
<td valign="top" class="required">Yes</td>
<td valign="top"><code></code></td>
<td valign="top"> The URL pattern that the route will match.</td>
</tr>
<tr >
<td valign="top"><code>controller</code></td>
<td valign="top"><code>string</code></td>
<td valign="top" class="required">No</td>
<td valign="top"><code></code></td>
<td valign="top"> Controller to call when route matches (unless the controller name exists in the pattern).</td>
</tr>
<tr class="highlight">
<td valign="top"><code>action</code></td>
<td valign="top"><code>string</code></td>
<td valign="top" class="required">No</td>
<td valign="top"><code></code></td>
<td valign="top"> Action to call when route matches (unless the action name exists in the pattern).</td>
</tr>
</tbody>
</table>
<h2>Examples</h2>
<code class="block">
<span id='formatted_code_12E78CB95AB8F7AC2A5539BE96D054CD' style='color:#000'><span style='color:Gray;'><!--- Example 1: Adds a route which will invoke the `profile` action on the `user` controller with `params.userName` set when the URL matches the `pattern` argument ---></span><br /><span style='color:#990033'><cfset<span style='color:#990033'> addRoute(name=<span style='color:#1600ff'>"userProfile"</span>, pattern=<span style='color:#1600ff'>"user/[username]"</span>, controller=<span style='color:#1600ff'>"user"</span>, action=<span style='color:#1600ff'>"profile"</span>)</span>></span><br /><br /><span style='color:Gray;'><!--- Example 2: Category/product URLs. Note the order of precedence is such that the more specific route should be defined first so Wheels will fall back to the less-specific version if it's not found ---></span><br /><span style='color:#990033'><cfset<span style='color:#990033'> addRoute(name=<span style='color:#1600ff'>"product"</span>, pattern=<span style='color:#1600ff'>"products/[categorySlug]/[productSlug]"</span>, controller=<span style='color:#1600ff'>"products"</span>, action=<span style='color:#1600ff'>"product"</span>)</span>></span><br /><span style='color:#990033'><cfset<span style='color:#990033'> addRoute(name=<span style='color:#1600ff'>"productCategory"</span>, pattern=<span style='color:#1600ff'>"products/[categorySlug]"</span>, controller=<span style='color:#1600ff'>"products"</span>, action=<span style='color:#1600ff'>"category"</span>)</span>></span><br /><span style='color:#990033'><cfset<span style='color:#990033'> addRoute(name=<span style='color:#1600ff'>"products"</span>, pattern=<span style='color:#1600ff'>"products"</span>, controller=<span style='color:#1600ff'>"products"</span>, action=<span style='color:#1600ff'>"index"</span>)</span>></span><br /><br /><span style='color:Gray;'><!--- Example 3: Change the `home` route. This should be listed last because it is least specific ---></span><br /><span style='color:#990033'><cfset<span style='color:#990033'> addRoute(name=<span style='color:#1600ff'>"home"</span>, pattern=<span style='color:#1600ff'>""</span>, controller=<span style='color:#1600ff'>"main"</span>, action=<span style='color:#1600ff'>"index"</span>)</span>></span><br /></span>
</code>
</d:entry>
<d:entry id="front_back_matter" d:title="Front/Back Matter">
<h1><b>CFWheels</b></h1>
<h2>Front/Back Matter</h2>
<div>
<br/><br/>
</div>
<div>
</div>
<div>
</div>
<br/>
</d:entry>
</d:dictionary>