src/magicphp/events.class.php
public static function Call($sName, $aParams = null){
            $oThis = self::CreateInstanceIfNotExists();
            $sName = strtolower(str_replace(array("/", "\\", "--"), "-", $sName));//Bugfix
                        
            if(array_key_exists($sName, $oThis->aEvents)){
                switch($oThis->aEvents[$sName]["type"]){
                    case "perroute":
                        $sCurrentRoute = strtolower(str_replace(array("/", "\\", "--"), "-", Storage::Get("route")));//Bugfix
                        $sRoute = strtolower($oThis->aEvents[$sName]["method"]."_".$oThis->aEvents[$sName]["route"]);
                        
                        if($sRoute == $sCurrentRoute)
                            return call_user_func($oThis->aEvents[$sName]["func"], $aParams);
                    break;
                    case "default": return call_user_func($oThis->aEvents[$sName]["func"], $aParams); break;
                } 
            }
            else{
                return false;
            }
        }
public static function Call($sName, $aParams = null){
            $oThis = self::CreateInstanceIfNotExists();
            $sName = strtolower(str_replace(array("/", "\\", "--"), "-", $sName));//Bugfix
                        
            if(array_key_exists($sName, $oThis->aEvents)){
                switch($oThis->aEvents[$sName]["type"]){
                    case "perroute":
                        $sCurrentRoute = strtolower(str_replace(array("/", "\\", "--"), "-", Storage::Get("route")));//Bugfix
                        $sRoute = strtolower($oThis->aEvents[$sName]["method"]."_".$oThis->aEvents[$sName]["route"]);
                        
                        if($sRoute == $sCurrentRoute)
                            return call_user_func($oThis->aEvents[$sName]["func"], $aParams);
                    break;
                    case "default": return call_user_func($oThis->aEvents[$sName]["func"], $aParams); break;
                } 
            }
            else{
                return false;
            }
        }
public static function Call ( $ sName , $ aParams = null ) { $ oThis = self :: CreateInstanceIfNotExists ( ) ; $ sName = strtolower ( str_replace ( array ( "/" , "\\" , "--" ) , "-" , $ sName ) ) ; //Bugfix if ( array_key_exists ( $ sName , $ oThis -> aEvents ) ) { switch ( $ oThis -> aEvents [ $ sName ] [ "type" ] ) { case "perroute" : $ sCurrentRoute = strtolower ( str_replace ( array ( "/" , "\\" , "--" ) , "-" , Storage :: Get ( "route" ) ) ) ; //Bugfix $ sRoute = strtolower ( $ oThis -> aEvents [ $ sName ] [ "method" ] . "_" . $ oThis -> aEvents [ $ sName ] [ "route" ] ) ; if ( $ sRoute == $ sCurrentRoute ) return call_user_func ( $ oThis -> aEvents [ $ sName ] [ "func" ] , $ aParams ) ; break ; case "default" : return call_user_func ( $ oThis -> aEvents [ $ sName ] [ "func" ] , $ aParams ) ; break ; } } else { return false ; } }
Function to call the event

@static
@access public
@param string $sName
@param array $aParams
@return mixed
Function to call the event