topical media & game development

talk show tell print

professional-php-10-class.Dispatcher.php / php



  <?php
  require_once('class.Event_Handler.php');
  require_once('class.Handler_View.php');
  require_once('class.Handler_Edit.php');
  
  class Dispatcher 
  {
  
     private handle;
  
     function __construct(event_handle){
        this->handle = event_handle;
     }
  
     function handle_the_event(){
        name = "handler_{this->handle}";
        if (class_exists("name")){
           handler_obj = new name(this->handle);
           response = handler_obj->handled_event();
           return response;
        }else{
           echo "I can't handle this!";
        }
     }
  }
  ?>
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.