From 1249107af8bad0434b310bda51d2de0a429a366c Mon Sep 17 00:00:00 2001 From: Derek Allard Date: Fri, 13 Jun 2008 20:03:39 +0000 Subject: Added "Using Associative Arrays In a Request Parameter" example to the XMLRPC userguide page. --- user_guide/changelog.html | 3 ++- 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

  • Added ability to use xss_clean() to test images for XSS, useful for upload security.
  • Improved security in xss_clean().
  • Considerably expanded list of mobile user-agents in config/user_agents.php.
  • -
  • Charset information in the userguide has been moved above title for internationalization purposes (#4614)
  • +
  • Charset information in the userguide has been moved above title for internationalization purposes (#4614).
  • +
  • Added "Using Associative Arrays In a Request Parameter" example to the XMLRPC userguide page.
  • 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 {

    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.

    +

    Using Associative Arrays In a Request Parameter

    + +

    If you wish to use an associative array in your method parameters you will need to use a struct datatype:

    + +$request = array(
    +                  array(
    +                        // Param 0
    +                        array(
    +                              'name'=>'John'
    +                              ),
    +                              'struct'
    +                        ),
    +                        array(
    +                              // Param 1
    +                              array(
    +                                    'size'=>'large',
    +                                    'shape'=>'round'
    +                                    ),
    +                              'struct'
    +                        )
    +                  );
    + $this->xmlrpc->request($request);
    + +

    You can retrieve the associative array when processing the request in the Server.

    +$parameters = $request->output_parameters();
    + $name = $parameters['0']['name'];
    + $size = $parameters['1']['size'];
    + $size = $parameters['1']['shape'];
    -

     

    XML-RPC Function Reference

    $this->xmlrpc->server()

    -- cgit v1.2.3-24-g4f1b