Guest User

Untitled

a guest
May 1st, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. class Action
  2. {
  3. public function method1($arg)
  4. {
  5. echo 'method1:'.$arg;
  6. }
  7.  
  8. public function method2($arg)
  9. {
  10. echo 'method2:'.$arg;
  11. }
  12. }
  13.  
  14. $act = new Action();
  15.  
  16. if (isset($_REQUEST['method']) && method_exists($act, $_REQUEST['method']))
  17. {
  18. $act->{$_REQUEST['method']}('value');
  19. }
Add Comment
Please, Sign In to add comment