Пример #1
0
<?php

$id = "(?P<id>[0-9]+)";
/* Index page */
Routing::match("", "post", "redirect");
/* List posts */
Routing::match("posts(?:\\/(?P<page>[0-9]+))?", "post", "index");
/* Add post */
Routing::match("posts\\/new", "post", "create");
/* Delete post */
Routing::match("posts\\/" . $id . "\\/delete", "post", "delete");
/*
	A few examples for routes:
	
	Simple paths
		Routing::match("about", "info", "about");
			This routes /about to InfoController::about.
	
	Multiple path segments
		Routing::match("subfolder\/page", "example", "hello");
			This routes /subfolder/page to ExampleController::hello.
	
	Simple regular expressions
		Routing::match("users\/[0-9]+\/details", "user", "details");
			This routes /users/102/details to UserController::details, for example.
	
	Capturing route parameters
		Routing::match("users\/(?P<id>[0-9]+)\/details", "user", "details");
			This does the same as above, but now the [0-9]+ expression is put in a
			named capture group: (?P<name> ... ), making the captured number
			available as a route parameter. All route parameters are passed as an