AJAX
[ class tree: AJAX ] [ index: AJAX ] [ all elements ]

Source for file auto_server.php

Documentation is available at auto_server.php

  1. <?php
  2. /**
  3.  * Server that exposes a class for doing a fake guestbook
  4.  *
  5.  * @category   HTML
  6.  * @package    AJAX
  7.  * @license    http://www.opensource.org/licenses/lgpl-license.php  LGPL
  8.  * @version    Release: 0.5.4
  9.  * @link       http://pear.php.net/package/HTML_AJAX
  10.  */
  11.  
  12.  // include the server class
  13. include 'HTML/AJAX/Server.php';
  14.  
  15.  
  16. // extend HTML_AJAX_Server creating our own custom one with init{ClassName} methods for each class it supports calls on
  17. class GuestbookServer extends HTML_AJAX_Server {
  18.     // this flag must be set to on init methods
  19.     var $initMethods = true;
  20.  
  21.     // init method for the test class, includes needed files an registers it for ajax
  22.     function initGuestbook({
  23.         include 'guestbook.class.php';
  24.         $this->registerClass(new Guestbook(),'guestbook',array('newEntry''clearGuestbook''deleteEntry''editEntry''updateSelect'))// specify methods so that we get case in php4
  25.     }
  26. }
  27.  
  28. // create an instance of our test server
  29. $server = new GuestbookServer();
  30.  
  31. // handle requests as needed
  32. $server->handleRequest();
  33. ?>

Documentation generated on Fri, 04 Apr 2008 18:30:12 -0400 by phpDocumentor 1.4.0. PEAR Logo Copyright © PHP Group 2004.