{"id":37006716,"url":"https://github.com/eser/scabbia2-router","last_synced_at":"2026-01-14T00:45:56.566Z","repository":{"id":56979266,"uuid":"42343411","full_name":"eser/scabbia2-router","owner":"eser","description":"Scabbia2 Router Component","archived":true,"fork":false,"pushed_at":"2016-01-03T00:15:50.000Z","size":19,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-27T14:56:37.934Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eser.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-Apache","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-09-12T03:39:25.000Z","updated_at":"2023-08-22T18:27:46.000Z","dependencies_parsed_at":"2022-08-21T10:50:14.256Z","dependency_job_id":null,"html_url":"https://github.com/eser/scabbia2-router","commit_stats":null,"previous_names":["eser/scabbia2-router","eserozvataf/scabbia2-router"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/eser/scabbia2-router","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eser%2Fscabbia2-router","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eser%2Fscabbia2-router/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eser%2Fscabbia2-router/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eser%2Fscabbia2-router/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eser","download_url":"https://codeload.github.com/eser/scabbia2-router/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eser%2Fscabbia2-router/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28406535,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T21:51:37.118Z","status":"ssl_error","status_checked_at":"2026-01-13T21:45:14.585Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-14T00:45:56.465Z","updated_at":"2026-01-14T00:45:56.559Z","avatar_url":"https://github.com/eser.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Scabbia2 Router Component\n\n[This component](https://github.com/eserozvataf/scabbia2-router) is a simple routing dispatcher which resolves and dispatchs the routes to callbacks or controllers.\n\n[![Build Status](https://travis-ci.org/eserozvataf/scabbia2-router.png?branch=master)](https://travis-ci.org/eserozvataf/scabbia2-router)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/eserozvataf/scabbia2-router/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/eserozvataf/scabbia2-router/?branch=master)\n[![Total Downloads](https://poser.pugx.org/eserozvataf/scabbia2-router/downloads.png)](https://packagist.org/packages/eserozvataf/scabbia2-router)\n[![Latest Stable Version](https://poser.pugx.org/eserozvataf/scabbia2-router/v/stable)](https://packagist.org/packages/eserozvataf/scabbia2-router)\n[![Latest Unstable Version](https://poser.pugx.org/eserozvataf/scabbia2-router/v/unstable)](https://packagist.org/packages/eserozvataf/scabbia2-router)\n[![Documentation Status](https://readthedocs.org/projects/scabbia2-documentation/badge/?version=latest)](https://readthedocs.org/projects/scabbia2-documentation)\n\n## Usage\n\n### Creating route definitions\n\n```php\nuse Scabbia\\Router\\RouteCollection;\n\n$routes = new RouteCollection();\n\n// adding a static route\n$routes-\u003eaddRoute('GET', '/about', 'AboutController::IndexAction');\n\n// adding a static route with multiple http methods\n$routes-\u003eaddRoute(['GET', 'POST'], '/about', 'AboutController::IndexAction');\n\n// adding a dynamic route\n$routes-\u003eaddRoute('GET', '/users/profile/{id:[a-z]+}', 'UsersController::ProfileAction');\n\n// adding a dynamic route with a routing name\n$routes-\u003eaddRoute('GET', '/users/posts/{id:[a-z]+}', 'UsersController::PostsAction', 'user/posts');\n```\n\n### Saving route definitions\n\n```php\nfile_put_contents('routes.json', json_encode($routes-\u003esave()));\n```\n\n### Loading route definitions back\n\n```php\n$routes = json_decode(file_get_contents('routes.json'));\n```\n\n### Dispatching a route\n\n```php\nuse Scabbia\\Router\\Router;\n\n$router = new Router($routes); // initialize a new router with route definitions\n$route = $router-\u003edispatch('GET', '/about');\n\nif ($route['status'] === Router::FOUND) {\n  call_user_func($route['callback'], ...$route['parameters']);\n}\n```\n\n### Reverse Routing with names\n\n```php\nuse Scabbia\\Router\\Router;\n\n$router = new Router($routes); // initialize a new router with route definitions\n\necho $router-\u003epath('users/posts', [ 'id' =\u003e 'eser' ]);\n```\n\n## Links\n- [List of All Scabbia2 Components](https://github.com/eserozvataf/scabbia2)\n- [Documentation](https://readthedocs.org/projects/scabbia2-documentation)\n- [Twitter](https://twitter.com/eserozvataf)\n- [Contributor List](contributors.md)\n- License Information [I](LICENSE-Apache) [II](LICENSE-Flask)\n\n\n## Contributing\nIt is publicly open for any contribution. Bugfixes, new features and extra modules are welcome. All contributions should be filed on the [eserozvataf/scabbia2-router](https://github.com/eserozvataf/scabbia2-router) repository.\n\n* To contribute to code: Fork the repo, push your changes to your fork, and submit a pull request.\n* To report a bug: If something does not work, please report it using GitHub issues.\n* To support: [![Donate](https://img.shields.io/gratipay/eserozvataf.svg)](https://gratipay.com/eserozvataf/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feser%2Fscabbia2-router","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feser%2Fscabbia2-router","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feser%2Fscabbia2-router/lists"}