{"id":18411436,"url":"https://github.com/sirodiaz/routify","last_synced_at":"2025-04-12T22:55:46.122Z","repository":{"id":57051934,"uuid":"50313472","full_name":"SiroDiaz/Routify","owner":"SiroDiaz","description":"A simple PHP router.","archived":false,"fork":false,"pushed_at":"2016-08-10T08:56:10.000Z","size":43,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T22:55:40.779Z","etag":null,"topics":["php","php-router","router","routify"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SiroDiaz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-01-24T23:22:39.000Z","updated_at":"2017-02-14T21:59:43.000Z","dependencies_parsed_at":"2022-08-24T03:40:50.663Z","dependency_job_id":null,"html_url":"https://github.com/SiroDiaz/Routify","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiroDiaz%2FRoutify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiroDiaz%2FRoutify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiroDiaz%2FRoutify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiroDiaz%2FRoutify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SiroDiaz","download_url":"https://codeload.github.com/SiroDiaz/Routify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248643050,"owners_count":21138353,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["php","php-router","router","routify"],"created_at":"2024-11-06T03:37:02.161Z","updated_at":"2025-04-12T22:55:46.103Z","avatar_url":"https://github.com/SiroDiaz.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Routify\n=======\n[![Build Status](https://travis-ci.org/SiroDiaz/Routify.svg)](https://travis-ci.org/SiroDiaz/Routify)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/SiroDiaz/Routify/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/SiroDiaz/Routify/?branch=master)\n\nA simple PHP router inspired in Express framework.\n\n\nRoutify is a fast and flexible router for PHP 5.4 and higher.\n\n- Flexible regular expression routing (inspired by Express)\n- Concrete use. Focused in do well one thing\n- Easy to learn. Simple API that will remember you Express or Slim\n\n### Getting started\n\n1. PHP 5.4.x is required\n2. Install Routify using Composer (recommended) or manually\n3. Setup URL rewriting so that all requests are handled by index.php, for example, using an .htaccess file\n\n### Example\n\n```php\nrequire 'vendor/autoload.php';\n\n$router = new Routify\\Router();\n\n$middleware1 = function() {\n    echo \"middleware 1\";\n};\n\n$middleware2 = function() {\n    echo \"middleware 2\";\n};\n\n$router-\u003eget('/', function() {\n        echo \"This is an action\";\n    },\n    ['before' =\u003e $middleware1, 'after' =\u003e $middleware2]\n);\n\n$router-\u003eget('/post/:slug/:id', function($slug, $id) {\n\techo \"You are seeing the post nº $id, with title: $slug\";\n});\n\n$router-\u003epost('/new', function() {\n\t// something for the POST /new\n});\n\n$router-\u003eput('/', function() {\n\t// something for the PUT /\n});\n\n$router-\u003edelete('/:id', function($id) {\n\t// something for the DELETE /:id\n});\n\n$router-\u003eboth('/hello/world', function() {\n    // something for GET and POST requests\n}, ['GET', 'POST']);\n\n$router-\u003eany('/bye', function() {\n    // something for any request method\n}, ['before' =\u003e $middleware1, 'after' =\u003e $middleware2]);\n\n// regular expression route\n$router-\u003eget('/(login|logout), function() {\n    // response for the login or logout route requested\n});\n\n$router-\u003erun();\n```\n\n### Tests and submit code\n\nNew features or modifications must be tested with **PHPUnit** previously to pull requests of new code.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsirodiaz%2Froutify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsirodiaz%2Froutify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsirodiaz%2Froutify/lists"}