Example #1
0
 public static function create($a)
 {
     if (array_key_exists('module', $a)) {
         $route = new \Route($a['module']);
         if (array_key_exists('couple', $a)) {
             $route->handler->set_default_loader(\Loaders\Module::create($a, $a['module']));
         }
         if (array_key_exists('pattern', $a)) {
             $route->add_pattern($a['pattern']);
         }
         if (array_key_exists('first_pattern', $a)) {
             $route->set_first_pattern($a['first_pattern']);
         }
         return $route;
     }
 }