Пример #1
0
 /**
  * Return [["/path", "testAction", [ "method" => ... ] ],...]
  *
  */
 public function getActionRoutes()
 {
     $pairs = array();
     $actions = $this->getActionMethods();
     foreach ($actions as $actionName => $actionInfo) {
         list($annotations, $meta) = $actionInfo;
         if (isset($annotations['Route'])) {
             $path = $annotations['Route'];
         } else {
             if ($actionName === 'indexAction') {
                 $path = '';
             } else {
                 $path = $this->translatePath($actionName);
                 // '/' . preg_replace_callback('/[A-Z]/', function($matches) {
             }
         }
         $pair = array($path, $actionName);
         if (isset($annotations['Method'])) {
             $pair[] = array('method' => Mux::getRequestMethodConstant($annotations['Method']));
         } else {
             $pair[] = array();
         }
         $pairs[] = $pair;
     }
     return $pairs;
 }