Example #1
0
 /**
  * 处理路由action
  * 
  * @param RouteInterface $route
  * @return void
  */
 protected function _handleRouteAction(RouteInterface $route)
 {
     $routeParameters = $route->getRouteParameters();
     if (!empty($routeParameters)) {
         $action = preg_replace_callback('#\\{([a-zA-Z0-9_,]*)\\}#', function ($matches) use($routeParameters) {
             if (isset($routeParameters[$matches[1]])) {
                 return $routeParameters[$matches[1]];
             }
         }, $route->getParameter('action'));
         $route->setParameter('action', $action);
     }
 }