Exemple #1
0
 /**
  * create routing cache
  *
  * @return  array
  */
 private function createMethodsCache()
 {
     $routing = $this->route->getRouting();
     $config = array();
     foreach ($routing as $key => $route) {
         $route['alias'] = $key;
         if (!isset($route['methods'])) {
             $config[$key] = $route;
             continue;
         }
         if (isset($route['methods']) && !in_array(strtoupper($route['methods']), $this->methods)) {
             continue;
         }
         if (isset($route['methods']) && $this->route->getCurrentMethod() != strtoupper($route['methods'])) {
             continue;
         }
         $config[$key] = $route;
     }
     $config = ArrayToolkit::index($config, 'pattern');
     return $config;
 }