예제 #1
0
파일: start.php 프로젝트: ericobi797/gliver
     if (!file_exists(__DIR__ . '/../application/routes.php')) {
         throw new Exceptions\BaseException("The defined routes file cannot be found! Please restore if you deleted");
     }
     //get the defined routes
     $routes = (include __DIR__ . '/../application/routes.php');
 } catch (Exceptions\BaseException $error) {
     $error->show();
     return;
 }
 $routeObj = new Drivers\Routes\Implementation();
 //there is a defined route
 if ($routeObj->dispatch($url, $routes)) {
     //get the controller name
     ($controller = $routeObj->getController()) || ($controller = 'Home');
     //get the action name
     ($action = $routeObj->getMethod()) || ($action = 'Index');
     //get parameters
     $parameters = $routeObj->getParameters();
 } else {
     //create an instance of the url parser
     $urlObj = new Drivers\Utilities\UrlParser($url);
     //get the controller name
     ($controller = $urlObj->getController()) || ($controller = 'Home');
     //get the action name
     ($action = $urlObj->getMethod()) || ($action = 'Index');
     //get parameters
     $parameters = $urlObj->getParameters();
 }
 //check if this class and method exists
 try {
     //get the namespaced controller class
예제 #2
0
파일: start.php 프로젝트: joycekenya/gliver
     if (!file_exists(__DIR__ . '/../application/routes.php')) {
         throw new Exceptions\BaseException("The defined routes file cannot be found! Please restore if you deleted");
     }
     //get the defined routes
     $routes = (include __DIR__ . '/../application/routes.php');
 } catch (Exceptions\BaseException $error) {
     $error->show();
     return;
 }
 $routeObj = new Drivers\Routes\Implementation();
 //there is a defined route
 if ($routeObj->dispatch(Drivers\Registry::getUrl(), $routes)) {
     //get the controller name
     ($controller = $routeObj->getController()) || ($controller = $config['default']['controller']);
     //get the action name
     ($action = $routeObj->getMethod()) || ($action = $config['default']['action']);
     //get parameters
     $parameters = $routeObj->getParameters();
 } else {
     //create an instance of the url parser
     $urlObj = new Drivers\Utilities\UrlParser(Drivers\Registry::getUrl());
     //get the controller name
     ($controller = $urlObj->getController()) || ($controller = $config['default']['controller']);
     //get the action name
     ($action = $urlObj->getMethod()) || ($action = $config['default']['action']);
     //get parameters
     $parameters = $urlObj->getParameters();
 }
 //check if this class and method exists
 try {
     //get the namespaced controller class