Login   Register  
PHP Classes
elePHPant
Icontem

File: sample.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Jean Machuca  >  Event Handler  >  sample.php  >  Download  
File: sample.php
Role: Example script
Content type: text/plain
Description: Sample code
Class: Event Handler
Define and process server side events
Author: By
Last change:
Date: 2006-07-31 13:32
Size: 758 bytes
 

Contents

Class file image Download
<?php
define 
('NOAUTOCONNECT',true);
include_once(
"smarty/libs/Smarty.class.php");
include_once(
"class.Event.php");
include_once(
"class._Main.php");

class 
Main extends _Main {
    
    function 
Main(){
        
$this->onLoad = array(&$this,'Process');
        
$this->onRender = array(&$this,'Draw');
        return 
parent::_Main();
    }
    
    function 
Process(){
        return 
true;
    }
    
    function 
Draw(){
        return 
true;
    }
    
    function 
__destruct(){
        unset(
$this);
    }
}
class 
Sample extends Main {
    
    function 
Sample(){
        
$this->onError = array(&$this,'CustomErrorHandler');
        
parent::Main();
    }
    
    function 
CustomErrorHandler(){
        echo 
"ERROR NIVEL 1 <br>";
        return 
true;
    }
    function 
__destruct(){
        unset(
$this);
    }
}
$oMain = new Sample();
?>