/** * 添加route * * @param RouteInterface $route */ function add(RouteInterface $route) { if ($route->hasParameter('name')) { $routeKey = $route->getParameter('name'); $this->_names[$routeKey] = $route; } $action = $route->getParameter('action'); if (!empty($action) && is_string($action)) { $routeKey = $route->getPrefix() . '/' . $action; $this->_actions[$routeKey] = $route; } }