diff options
-rw-r--r-- | user_guide/changelog.html | 3 | ||||
-rw-r--r-- | user_guide/libraries/xmlrpc.html | 29 |
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 "Using Associative Arrays In a Request Parameter" 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'=>'John'<br />
+ ),<br />
+ 'struct'<br />
+ ),<br />
+ array(<br />
+ // Param 1<br />
+ array(<br />
+ 'size'=>'large',<br />
+ 'shape'=>'round'<br />
+ ),<br />
+ 'struct'<br />
+ )<br />
+ );<br />
+ $this->xmlrpc->request($request);</code>
+
+<p>You can retrieve the associative array when processing the request in the Server.</p>
+<code>$parameters = $request->output_parameters();<br />
+ $name = $parameters['0']['name'];<br />
+ $size = $parameters['1']['size'];<br />
+ $size = $parameters['1']['shape']; </code>
-<p> </p>
<h1>XML-RPC Function Reference</h1>
<h2>$this->xmlrpc->server()</h2>
|