예제 #1
0
<?php

require '../Rebond/Config.php';
$app = \Rebond\Config::start();
$app->launch();
// read request uri
list($module, $action) = \Rebond\Util\Nav::readRequest($_SERVER['REQUEST_URI']);
$file = '../Rebond/Controller/Site/' . $module . '.php';
// check controller
if (!file_exists($file)) {
    \Rebond\Util\Error::kill(\Rebond\Util\Error::PAGE_NOT_FOUND, $module . '/' . $action, __FILE__, __LINE__);
}
// call controller
$request = '\\Rebond\\Controller\\Site\\' . $module;
$controller = new $request($app);
// check method
if (!method_exists($controller, $action)) {
    \Rebond\Util\Error::kill(\Rebond\Util\Error::PAGE_NOT_FOUND, $module . '/' . $action, __FILE__, __LINE__);
}
// call method
echo $controller->{$action}();