Lists all Message entities.

don't like this. Using just "/" which would be logical makes the
routecomponent match every GET below this one.
Another option is to put this one as the last one.
@Route("/me", * name="message", methods={"GET"})
546997
public function indexAction(Request $request, $access)
    {
        $sm = $this->container->get('sakonnin.messages');
        // Todo: paging or just show the last 20
        $messages = $sm->getMessagesForLoggedIn(array('not_message_type' => 'PM'));
        // Gotta set the messages as read.
        /* No, not while listing the messages, only when viewving separately.
        foreach ($messages as $message) {
            if ($message->getState() == "UNREAD")
                $message->setState('READ');
            $em = $this->getDoctrineManager();
            $em->flush();
        }
        */
        if ($this->isRest($access)) {
            return $this->returnRestData($request, $messages, array('html' =>'BisonLabSakonninBundle:Message:_index.html.twig'));
        }
        return $this->render('BisonLabSakonninBundle:Message:index.html.twig',
            array('entities' => $messages));
    }
1200477
public function getEntityName($_route = null)
    {
        if($_route == null) {
            $request = $this->get('request_stack')->getCurrentRequest();
            $_route = $request->attributes->get('_route');
        }
        $parts = explode('.', $_route);
        if(count($parts) == 2) {
            $namespace = $parts[0];
        }
        $_route = end($parts);
        $parts = explode('_', $_route);
        if(count($parts) > 1) {
            $entity = $parts[count($parts)-2];
        } else {
            $parts = explode(':', $_route);
            if(count($parts) == 2) {
                $entity = strtolower($parts[1]);
            }
        }
        //if((count($parts)-2) == -1) die(var_dump($_route));
        //die(var_dump(count($parts)));
        //die(var_dump($entity));
        return $entity;
    }
1277066
def _routes(self, app):
        
        _routes = []
        prefix = self.url_prefix if self.url_prefix is not None else ""
        for rule in app.url_map.iter_rules():
            if str(rule).startswith(prefix):
                _routes.append({
                    'path':rule.rule,
                    'name':rule.endpoint,
                    'methods':list(rule.methods)
                })
        returns = {
            'api': self.name,
            'url_root': request.url_root,
            'routes': _routes
        }
        return jsonify(returns)
429012
public void get(String path, Route route, ResponseTransformer transformer) {
        addRoute(HttpMethod.get, ResponseTransformerRouteImpl.create(path, route, transformer));
    }
1321737
@Override
    public String getReverseRouteFor(Controller controller, String method) {
        return getReverseRouteFor(controller.getClass(), method, null);
    }
1293542
function getMiddlewareNames(route) {
		var middleware = getRouteMiddleware(route);

		// If the middleware is an array, just return it
		if ( middleware instanceof Array ) {
			return middleware;
		}

		// If there is no middleware, then return an empty array
		if ( typeof middleware === 'undefined' ) {
			return [];
		}

		// Otherwise, split the pipes & return an array
		return middleware.split('|');
	}
464894
private function findRoute(array $pathSegments = null) {

	    if(!count($this->routes)) {
	        throw new ApplicationException('Routing aborted: No routes defined.');
        }

		// if no page given try to get the first from list

		if(empty($pathSegments)) {

			return reset($this->routes);
		}

		$pathToCheck	= implode('/', $pathSegments);
		$requestMethod	= Request::createFromGlobals()->getMethod();

		/* @var Route $foundRoute */

		$foundRoute = null;

        /* @var Route $default */

		$default = null;

		// iterate over routes and try to find the "best" match

        /* @var Route $route */

		foreach($this->routes as $route) {

			// keep default route as fallback, when no match is found

			if($route->getRouteId() === 'default') {
				$default = $route;
			}

			// pick route only when request method requirement is met

			if(
				preg_match('~^' . $route->getMatchExpression() . '$~', $pathToCheck) &&
				$route->allowsRequestMethod($requestMethod)
			) {

				// if no route was found yet, pick this first match

				if(!isset($foundRoute)) {
                    $foundRoute = $route;
                    continue;
                }

                // prefer route which is more specific with request methods

                if(count($route->getRequestMethods()) > count($foundRoute->getRequestMethods())) {
                    continue;
                }

                // a route with less (or no) placeholders is preferred over one with placeholders

                if(count($route->getPlaceholderNames()) > count($foundRoute->getPlaceholderNames())) {
                    continue;
                }

                // if a route has been found previously, choose the more "precise" and/or later one
                // choose the route with more satisfied placeholders
                // @todo could be optimized

                $foundRouteSatisfiedPlaceholderCount = count($this->getSatisfiedPlaceholders($foundRoute, $pathToCheck));
                $routeSatisfiedPlaceholderCount = count($this->getSatisfiedPlaceholders($route, $pathToCheck));

                if (
                    ($routeSatisfiedPlaceholderCount - count($route->getPlaceholderNames())) < ($foundRouteSatisfiedPlaceholderCount - count($foundRoute->getPlaceholderNames()))
                ) {
                    continue;
                }
                if (
                    ($routeSatisfiedPlaceholderCount - count($route->getPlaceholderNames())) === ($foundRouteSatisfiedPlaceholderCount - count($foundRoute->getPlaceholderNames())) &&
                    count($route->getPlaceholderNames()) > count($foundRoute->getPlaceholderNames())
                ) {
                    continue;
                }

                $foundRoute = $route;

			}
		}

		// return "normal" route, if found

		if(isset($foundRoute)) {
			return $foundRoute;
		}

		// return default route as fallback (if available)

		return $default;
	}
285786
private function getRoutesFromIndex (&$routes, &$routesIndex, &$requestMethod, &$requestPathParts, $requestPathIndex = 0) {
        if (!empty($requestPathParts[$requestPathIndex])) {
            $requestPathPart = $requestPathParts[$requestPathIndex];
            if (array_key_exists($requestPathPart, $routesIndex)) {
                $this->getRoutesFromIndex($routes,$routesIndex[$requestPathPart], $requestMethod, $requestPathParts, $requestPathIndex + 1);
            }
            if (array_key_exists(self::ROUTE_PARAMETER_WILDCARD, $routesIndex)) {
                $this->getRoutesFromIndex($routes,$routesIndex[self::ROUTE_PARAMETER_WILDCARD], $requestMethod, $requestPathParts, $requestPathIndex + 1);
            }
        }
        else if (array_key_exists(self::ROUTE_ACTIONS_KEY, $routesIndex)) {
            $testRoutes = &$routesIndex[self::ROUTE_ACTIONS_KEY];
            if (array_key_exists($requestMethod, $testRoutes)) {
                $this->getRoutesFromIndexActions($routes,$testRoutes[$requestMethod], $requestMethod,$requestPathParts);
            }
            if (array_key_exists(self::ROUTE_GENERIC_METHOD, $testRoutes)) {
                $this->getRoutesFromIndexActions($routes,$testRoutes[self::ROUTE_GENERIC_METHOD], $requestMethod, $requestPathParts);
            }
        }

        if (array_key_exists(self::ROUTE_GENERIC_ACTIONS_KEY, $routesIndex)) {
            $testRoutes = &$routesIndex[self::ROUTE_GENERIC_ACTIONS_KEY];
            if (array_key_exists($requestMethod, $testRoutes)) {
                $this->getRoutesFromIndexActions($routes,$testRoutes[$requestMethod], $requestMethod, $requestPathParts);
            }
            if (array_key_exists(self::ROUTE_GENERIC_METHOD, $testRoutes)) {
                $this->getRoutesFromIndexActions($routes,$testRoutes[self::ROUTE_GENERIC_METHOD], $requestMethod, $requestPathParts);
            }
        }
    }
1223193
function (route) {
  if (!route) {
    return null;
  }
  let ts = route.split('.');
  if (ts.length !== 3) {
    return null;
  }

  return {
    route: route,
    serverType: ts[0],
    handler: ts[1],
    method: ts[2]
  };
}
688764
def _get(self, url, method, host):
        
        url = unquote(host + url)
        # Check against known static routes
        route = self.routes_static.get(url)
        method_not_supported = MethodNotSupported(
            "Method {} not allowed for URL {}".format(method, url),
            method=method,
            allowed_methods=self.get_supported_methods(url),
        )
        if route:
            if route.methods and method not in route.methods:
                raise method_not_supported
            match = route.pattern.match(url)
        else:
            route_found = False
            # Move on to testing all regex routes
            for route in self.routes_dynamic[url_hash(url)]:
                match = route.pattern.match(url)
                route_found |= match is not None
                # Do early method checking
                if match and method in route.methods:
                    break
            else:
                # Lastly, check against all regex routes that cannot be hashed
                for route in self.routes_always_check:
                    match = route.pattern.match(url)
                    route_found |= match is not None
                    # Do early method checking
                    if match and method in route.methods:
                        break
                else:
                    # Route was found but the methods didn't match
                    if route_found:
                        raise method_not_supported
                    raise NotFound("Requested URL {} not found".format(url))

        kwargs = {
            p.name: p.cast(value)
            for value, p in zip(match.groups(1), route.parameters)
        }
        route_handler = route.handler
        if hasattr(route_handler, "handlers"):
            route_handler = route_handler.handlers[method]
        return route_handler, [], kwargs, route.uri
713849
def app_routes(app):
    
    _routes = []
    for rule in app.url_map.iter_rules():
        _routes.append({
            'path': rule.rule,
            'name': rule.endpoint,
            'methods': list(rule.methods)
        })
    return jsonify({'routes': _routes})
335874
def find_call(self, path, method):
        
        if not path.endswith('/'):
            path += '/'
        path = path.split('/')[1:]
        return self._recursive_route_match(self._routes, path, method, [])
919172
function routeObjToRouteName(route, path) {
    var name = route.controllerAs;

    var controller = route.controller;
    if (!name && controller) {
      if (angular.isArray(controller)) {
        controller = controller[controller.length - 1];
      }
      name = controller.name;
    }

    if (!name) {
      var segments = path.split('/');
      name = segments[segments.length - 1];
    }

    if (name) {
      name = name + 'AutoCmp';
    }

    return name;
  }
484761
protected final <REQ, RESP> Route get(RouteAction<Request<REQ>, Response<RESP>> action,
		RequestType<REQ> req, ResponseType<RESP> resp) {
		return createEntityRoute(HttpMethod.GET, "", action, req, resp);
	}
167638
function Message(instanceList, // @arg InstanceObject - address list. { id: instance, ... }
                 methodName) { // @arg MethodNameString = "inbox" - instance[method]
                               // @desc MessagePassing implementation.
    this._instanceList = instanceList;
    this._methodName   = methodName || "inbox";

//{@dev
    $valid($type(instanceList, "Object"),      Message, "instanceList");
    $valid($type(methodName,   "String|omit"), Message, "methodName");

    for (var id in instanceList) {
        $valid($type(instanceList[id][this._methodName], "Function"), Message, "methodName"); // instance has not method.
    }
//}@dev
}
1327868
function HttpRoute(route) {
    if (typeof route === 'string') {
        this.route = { url:route };
    }
    else if (typeof route === 'object') {
        this.route = route;
    }
    this.routeData = { };

    this.patterns = {
        int:function() {
            return "^[1-9]([0-9]*)$";
        },
        boolean:function() {
            return "^true|false$"
        },
        decimal:function() {
            return "^[+-]?[0-9]*\\.?[0-9]*$";
        },
        float:function() {
            return "^[+-]?[0-9]*\\.?[0-9]*$";
        },
        guid:function() {
            return "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$";
        },
        plural: function() {
            return "^[a-zA-Z]+$";
        },
        string: function() {
            return "^'(.*)'$"
        },
        date:function() {
            return "^(datetime)?'\\d{4}-([0]\\d|1[0-2])-([0-2]\\d|3[01])(?:[T ](\\d+):(\\d+)(?::(\\d+)(?:\\.(\\d+))?)?)?(?:Z(-?\\d*))?([+-](\\d+):(\\d+))?'$";
        },
    };

    this.parsers = {
        int:function(v) {
            return parseInt(v);
        },
        boolean:function(v) {
            return (/^true$/ig.test(v));
        },
        decimal:function(v) {
            return parseFloat(v);
        },
        float:function(v) {
            return parseFloat(v);
        },
        plural:function(v) {
            return pluralize.singular(v);
        },
        string:function(v) {
            return v.replace(/^'/,'').replace(/'$/,'');
        },
        date:function(v) {
            return new Date(Date.parse(v.replace(/^(datetime)?'/,'').replace(/'$/,'')));
        }
    }

}
829128
def content_for route
      parts = route.split("/").delete_if &:empty?
      content = parts.inject(self) do |page, part|
        page.children[part.to_sym] if page
      end
      content
    end