summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDerek Allard <derek.allard@ellislab.com>2008-06-13 22:03:39 +0200
committerDerek Allard <derek.allard@ellislab.com>2008-06-13 22:03:39 +0200
commit1249107af8bad0434b310bda51d2de0a429a366c (patch)
tree3f621b3097723fa17ab8793e2f7a07d0b8d44bea
parent61860c92fc3bf693537837448b584f2c8485ee46 (diff)
Added "Using Associative Arrays In a Request Parameter" example to the XMLRPC userguide page.
-rw-r--r--user_guide/changelog.html3
-rw-r--r--user_guide/libraries/xmlrpc.html29
2 files changed, 30 insertions, 2 deletions
diff --git a/user_guide/changelog.html b/user_guide/changelog.html
index db968b0c2..d004da640 100644
--- a/user_guide/changelog.html
+++ b/user_guide/changelog.html
@@ -85,7 +85,8 @@ SVN Revision: not currently released</p>
<li>Added ability to <a href="libraries/input.html">use xss_clean() to test images</a> for XSS, useful for upload security.</li>
<li>Improved security in <kbd>xss_clean()</kbd>.</li>
<li>Considerably expanded list of mobile user-agents in config/user_agents.php.</li>
- <li>Charset information in the userguide has been moved above title for internationalization purposes (#4614)</li>
+ <li>Charset information in the userguide has been moved above title for internationalization purposes (#4614).</li>
+ <li>Added &quot;Using Associative Arrays In a Request Parameter&quot; example to the <a href="libraries/xmlrpc.html">XMLRPC userguide page</a>.</li>
</ul>
</li>
</ul>
diff --git a/user_guide/libraries/xmlrpc.html b/user_guide/libraries/xmlrpc.html
index e426f7008..e3d519037 100644
--- a/user_guide/libraries/xmlrpc.html
+++ b/user_guide/libraries/xmlrpc.html
@@ -398,9 +398,36 @@ class Xmlrpc_server extends Controller {
<p>The client you created sends a message ("How's is going?") to the server, along with a request for the "Greetings" method.
The Server receives the request and maps it to the "process" function, where a response is sent back.</p>
+<h2>Using Associative Arrays In a Request Parameter</h2>
+
+<p>If you wish to use an associative array in your method parameters you will need to use a struct datatype:</p>
+
+<code>$request = array(<br />
+                  array(<br />
+                        // Param 0<br />
+                        array(<br />
+                              'name'=&gt;'John'<br />
+                              ),<br />
+                              'struct'<br />
+                        ),<br />
+                        array(<br />
+                              // Param 1<br />
+                              array(<br />
+                                    'size'=&gt;'large',<br />
+                                    'shape'=&gt;'round'<br />
+                                    ),<br />
+                              'struct'<br />
+                        )<br />
+                  );<br />
+ $this-&gt;xmlrpc-&gt;request($request);</code>
+
+<p>You can retrieve the associative array when processing the request in the Server.</p>
+<code>$parameters = $request-&gt;output_parameters();<br />
+ $name = $parameters['0']['name'];<br />
+ $size = $parameters['1']['size'];<br />
+ $size = $parameters['1']['shape']; </code>
-<p>&nbsp;</p>
<h1>XML-RPC Function Reference</h1>
<h2>$this->xmlrpc->server()</h2>