alexisgt01 / we-router
PHP Router based on Laravel syntax
Installs: 7
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:package
Requires
- php: >=5.6.0
Requires (Dev)
- larapack/dd: ^1.1
- phpunit/phpunit: ^9.1
This package is auto-updated.
Last update: 2025-03-22 05:41:58 UTC
README
composer require alexisgt01/we-router
// router.php
use WeRouter\Router;
Router::setNamespace("App\\Controllers\\");
Router::get('/', 'HomeController@home');
Router::get('/article/{id}/{type}', 'HomeController@article');
Router::get('posts/{id}', function ($data) {
echo $data['id'];
});
Router::post('/posts/create', 'PostController@create');
Router::post('/posts/create/{type}', function ($data) {
echo $data['type'] . "\n";
echo $data['input'];
});
Router::run();