private function runModule()
 {
     switch ($this->sModule) {
         case "Home":
             $oController = new HomeController();
             $oController->run($this->sAction, $this->asArgs, $this->sView);
             break;
         case "ShowRoom":
             $oController = new ShowRoomController();
             $oController->run($this->sAction, $this->asArgs, $this->sView);
             break;
         case "Basic":
             $oController = new BasicController();
             $oController->run($this->sAction, $this->asArgs, $this->sView);
             break;
         case "Products":
             $oController = new ProdutosController();
             $oController->run($this->sAction, $this->asArgs, $this->sView);
             break;
         default:
             echo "Erro: Módulo não existe";
     }
     /* switch ( $this->sModule ) */
 }
Esempio n. 2
0
        $controller .= "Controller";
        if (class_exists($controller)) {
            $page = new $controller();
            $action = str_replace(chr(0), '', $_GET['action']);
            if (method_exists($page, $action)) {
                $homepage = false;
                $page->run($action);
                $fail = false;
            }
        }
        if ($fail) {
            throw new Error404('Action not found');
        }
    } else {
        // We didn't render an action, let's render the index
        $page = new HomeController();
        $page->run('index');
        //$page = new EventController();
        //$page->run('coverage', 'epic13');
    }
} catch (WebException $e) {
    $e->notify();
    $e->render();
} catch (Exception $e) {
    Email::send_exception_email($e);
    $newError = new Error500('An unexpected error occurred');
    $newError->render();
}
?>