Beispiel #1
0
        $Obj = $s;
    } else {
        // Si method non static : init objet and fire Page_ServiceLoad event
        $Obj = new $s();
        \Core\Event::fire("Page_ServiceLoad", $_REQUEST, $Obj);
    }
    $Url = $_REQUEST->parse();
    $params = array($_REQUEST);
    // add url params (Custom made Redirect Url) (todo array_merge with order)
    foreach ($Url["params"] as $p) {
        $params[] = $p;
    }
    $res = \Core\Task::execTask($Obj, $r, $params);
    $str = \Core\Task::renderTask($res);
    $eventReturn = \Core\Event::fire("Page_BeforeRender", $_REQUEST, $str);
    // Apply BeforeRender funciton to change custom output
    if (is_string($eventReturn)) {
        echo $eventReturn;
    } else {
        // supp eventuel trans si module non chargé
        $str = preg_replace("!<trans>(.{1,})</trans>!isU", "\$1", $str);
        echo $str;
    }
    \Core\Event::fire("Page_TaskLoad", $_REQUEST, $Obj, $r, $res);
} catch (\Core\CException $exception) {
    \Core\Event::fire("Page_ServiceError", $_REQUEST, $exception);
    $message = $exception->getMessage();
    \Core\Server::sendHeaderStatus(500);
    die($exception->getMessage());
}
\Core\Event::fire("Page_Load", $_REQUEST, $Obj, $res);