Location: PHPKode > scripts > Dispatcher > dispatcher/HandlerShow.php
<?php
/**
 * @li gnu/agpl v3 or later
 * @code utf8
 * @version 0.1
 * @author cojack from Aichra.pl
 * @date 22.09.09
 *
 **/

/**
 * We require a Event Handler abstract class
 */
require_once('EventHandler.php');

/**
 * @class HandlerShow
 * 
 * An example of usage a dispatcher, ofcourse it's not good idea to static require a event handler in dispatcher
 * 
 */

class HandlerShow extends EventHandler {

  private $_handle;

  public function __construct($event){
    $this->_handle = $event;
  }

  public function handledEvent(){
    // so for example we can here get a db handle from extended abstract class, like it:
    $dbHandle = parent::dbConn();

    // here we can also trows exceptions, and it'll be catched in Dispatcher

    // also we can call a method from model to get a some data from db
    /*
      $articlesObj = new ArticlesModel($dbHandle);
      return $articlesObj->getAllArticles();
    */
    
    // or just for example we will print some text
    return ('Hello World');
  }

}
Return current item: Dispatcher