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

Source for file interceptor.php

Documentation is available at interceptor.php

  1. <?php
  2. class Interceptor {
  3.  
  4.     /**
  5.      * A global interceptor runs all calls not matched by a more specific rule
  6.      * This example creates a not logged in error
  7.      */
  8.     function intercept($className,$methodName,$params{
  9.  
  10.         // if you were using php5 you could throw an exception instead of using trigger_error
  11.         trigger_error("Not logged in: $className::$methodName");
  12.  
  13.         return $params;
  14.     }
  15.  
  16.     /**
  17.      * A class level interceptor for the test class
  18.      * This examples sets the first parameter to the method name
  19.      */
  20.     function test($methodName,$params{
  21.         $params[0'Intercepted: '.$methodName.' - Original: '.$params[0];
  22.  
  23.         return $params;
  24.     }
  25.  
  26.     /**
  27.      * A method level interceptor for the test::test1 method
  28.      * This examples sets the first parameter to boink
  29.      */
  30.     function test_test1($params{
  31.         $params[0'Intercepted: boink - Original: '.$params[0];
  32.  
  33.         return $params;
  34.     }
  35. }

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