Route · Mecha CMS

Do something if URL path matched with pattern.

$route::pattern()

Author: Taufik Nurrohman · 144 Views

Tweet

Set a route with plain regular expression pattern.

Route::pattern($pattern, $fn = false, $stack = null);

Example:

Route::pattern('#^blog(?:\/([^\/]+))?(?:\/(\d+))?$#', function($slug = "", $step = 1) { … });