{"id":18540120,"url":"https://github.com/alin11/routerion","last_synced_at":"2025-04-09T18:30:54.594Z","repository":{"id":56945716,"uuid":"127108840","full_name":"AliN11/Routerion","owner":"AliN11","description":"PHP fast and powerful router","archived":false,"fork":false,"pushed_at":"2019-02-25T07:49:44.000Z","size":14,"stargazers_count":10,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-24T10:05:16.327Z","etag":null,"topics":["php","rest-api","router"],"latest_commit_sha":null,"homepage":null,"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/AliN11.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":"2018-03-28T08:27:56.000Z","updated_at":"2023-01-12T15:03:00.000Z","dependencies_parsed_at":"2022-08-21T02:40:19.581Z","dependency_job_id":null,"html_url":"https://github.com/AliN11/Routerion","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AliN11%2FRouterion","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AliN11%2FRouterion/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AliN11%2FRouterion/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AliN11%2FRouterion/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AliN11","download_url":"https://codeload.github.com/AliN11/Routerion/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248087643,"owners_count":21045556,"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","rest-api","router"],"created_at":"2024-11-06T19:53:04.925Z","updated_at":"2025-04-09T18:30:54.244Z","avatar_url":"https://github.com/AliN11.png","language":"PHP","readme":"# Routerion - PHP Router\n\nA simple, fast and powerful PHP router\n\n* Define routes easily\n* Dynamic route parameters\n* Supports various HTTP methods\n* REST API Support\n\n## Installation\n\n1. You can install Routerion with composer:\n\n```$ composer require alin11/routerion```\n\n\n2. Create a `.htaccess` file on the root directory:\n\n```htaccess\nOptions +FollowSymLinks\nRewriteEngine On\n\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteCond %{REQUEST_URI} (.+)/$\nRewriteRule ^ %1 [L,R=301]\n\nRewriteRule ^(.*)$ index.php [NC,L]\n```\n\n3. Create `config.php` file or add following `PHP Constants` to your configuration file:\n\n```php\n\u003c?php\ndefine('CONTROLLER_PATH', __DIR__ . '\\Controllers');\ndefine('CONTROLLER_NAMESPACE', '\\Controllers');\n```\n\n## Usage\n\nLet's define our routes. To define routes create a `index.php` file on the root directory if not exists, or create a `routes.php` file and include it into `index.php` file:\n\n```php\n\u003c?php\n\nrequire 'config.php';\nrequire __DIR__.'/vendor/autoload.php';\n\n$route = new Routerion\\Route(new Routerion\\Exceptions\\APIException);\n\n\n$route-\u003eget('/', 'HomeController@index');\n$route-\u003eget('/users', 'Auth\\UsersController@index');\n$route-\u003eget('/users/{name}/{age?}', 'Auth\\UsersController@single');\n\n$route-\u003epost('/get-user-info/{id}', 'Auth\\UsersController@getUserInfo');\n\n$route-\u003eget('closure', function(){\n  echo 'This is closure';\n});\n\n\n$route-\u003eget('closure-with-parameters/{required}/{optional?}', function($required, $optional = null){\n  echo $required;\n  echo $optional;\n});\n\n$route-\u003erun();\n```\n\n\n### Controllers\n\nController files are located in `Controllers` directory. Edit `config.php` constants if you have different controllers directory or namespace.\n\n\n## License\n\nMIT Licensed: \u003chttp://www.opensource.org/licenses/MIT\u003e","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falin11%2Frouterion","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falin11%2Frouterion","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falin11%2Frouterion/lists"}