Example #1
0
File: Router.php Project: h1soft/h
 private function _defaultController()
 {
     Application::checkController(\hmvc\Web\Config::get('router.controller'), 'Index');
     Application::checkAction(\hmvc\Web\Config::get('router.action'), 'Index');
 }
Example #2
0
 public static function checkAction($_name)
 {
     if (!self::$_router->getController()) {
         Application::checkController(\hmvc\Web\Config::get('router.controller'), 'Index');
     }
     if (self::$_router->getController() instanceof Controller && method_exists(self::$_router->getController(), $_name . 'Action')) {
         self::$_router->setAction($_name . 'Action');
         return true;
     } else {
         if (self::$_router->getController() instanceof RestController) {
             self::$_router->setAction($_name);
             return true;
         }
     }
     return false;
 }