Ejemplo n.º 1
0
 static function isRoutable($apps, $controller, $method, $http_method)
 {
     //header('Content-Type: text/plain');
     if (!empty($apps)) {
         $apps[] = '';
     }
     // petit trick pour avoir un antislash final
     $class = 'app\\' . join('\\', $apps) . 'controllers\\' . ucfirst($controller);
     $method = str_replace('-', '', mb_convert_case($method, MB_CASE_TITLE, "UTF-8")) . 'Action';
     if (class_exists($class)) {
         if (Tools::method_exists($class, $http_method . $method)) {
             return array(array_filter($apps), $class, $http_method . $method);
         } else {
             if (Tools::method_exists($class, 'any' . $method)) {
                 return array(array_filter($apps), $class, 'any' . $method);
             } else {
                 return false;
             }
         }
     }
     return false;
 }