jadob / router
Matches requests to controllers.
v0.7.9
2025-04-04 22:02 UTC
- dev-master
- v0.7.9
- v0.7.8
- v0.7.7
- v0.7.5
- v0.7.4
- v0.7.3
- v0.7.2
- v0.7.1
- v0.7.0
- v0.6.0
- v0.5.0
- v0.4.23
- v0.4.22
- v0.4.21
- v0.4.20
- v0.4.19
- v0.4.18
- v0.4.17
- v0.4.16
- v0.4.15
- v0.4.14
- v0.4.13
- v0.4.12
- v0.4.11
- v0.4.10
- v0.4.9
- v0.4.8
- v0.4.7
- v0.4.6
- v0.4.5
- v0.4.4
- v0.4.3
- v0.4.2
- v0.4.1
- v0.4.0
- v0.3.0
- v0.2.6
- v0.2.5
- v0.2.4
- v0.2.3
- v0.2.2
This package is auto-updated.
Last update: 2025-05-04 01:43:19 UTC
README
Routing component for Jadob Framework
Getting Started
//Creating and configuring router instance: //defining routes: $routes = [ 'home' => [ 'path' => '/', //required 'controller' => 'Your/App/Controller::class, //required 'action' => 'index' //not required 'ignore_global_prefix' => true //if true, ], ]; //if you need to add a set of routes with a common prefix: $collection = new \Jadob\Router\RouteCollection(); $collection->setPrefix('/backend'); // this route will be matched on URI "/backend/posts/new" $backendRoute = (new Route('backend_new_post')) ->setPath('/posts/new') ->setController(\Your\App\BackendController::class) ->setAction('newPost'); $collection->addRoute($backendRoute); //when collection is passed to array, his key is ignored $routes['backend_collection'] = $collection; $routerConfig = [ 'routes' => $routes ]; $router = new \Jadob\Router\Router($routerConfig);
Changelog
- 0.70.1 -
locale_prefix
renamed toglobal_prefix
.