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

Source for file test.class.php

Documentation is available at test.class.php

  1. <?php
  2. /**
  3.  * Test class used in other examples
  4.  * Constructors and private methods marked with _ are never exported in proxies to JavaScript
  5.  * 
  6.  * @category   HTML
  7.  * @package    AJAX
  8.  * @author     Joshua Eichorn <josh@bluga.net>
  9.  * @copyright  2005 Joshua Eichorn
  10.  * @license    http://www.opensource.org/licenses/lgpl-license.php  LGPL
  11.  * @version    Release: @package_version@
  12.  * @link       http://pear.php.net/package/HTML_AJAX
  13.  */
  14. class test {
  15.     function test({
  16.     }
  17.     function _private({
  18.     }
  19.     function echo_string($string{
  20.         return "From PHP: ".$string;
  21.     }
  22.     function slow_echo_string($string{
  23.         sleep(2);
  24.         return "From PHP: ".$string;
  25.     }
  26.     function error_test($string{
  27.         trigger_error($string);
  28.     }
  29.     function multiarg({
  30.         $args func_get_args();
  31.         return "passed in ".count($args)." args ".implode('|',$args);
  32.     }
  33.     function cookies({
  34.         return $_COOKIE;
  35.     }
  36. }
  37.  
  38. if (isset($_GET['TEST_CLASS'])) {
  39.     $t = new test();
  40.     var_dump($t->echo_string('test string'));
  41.     var_dump($t->slow_echo_string('test string'));
  42.     var_dump($t->error_test('test string'));
  43.     var_dump($t->multiarg('arg1','arg2','arg3'));
  44. }
  45. ?>

Documentation generated on Mon, 11 Mar 2019 14:11:20 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.