Download .zip |
Info | Example | View files (14) | Download .zip | Reputation | Support forum | Blog | Links |
Last Updated | Ratings | Unique User Downloads | Download Rankings | |||||
2017-04-04 (1 month ago) | Not yet rated by the users | Total: Not yet counted | Not yet ranked |
Version | License | PHP version | Categories | |||
routers 1.0 | GNU General Publi... | 5 | HTTP, PHP 5, Design Patterns |
Description | Author | |
This package can route HTTP requests to given callback functions. |
>Examples
<?php use App\Router\Router;
$router = new App\Router\Router($_SERVER["REQUEST_URI"]); $router->get('/',function(){
echo 'home page';
});
$router->get('/posts/:id-:slug',function($id, $slug) use ($router){
echo $router->url('Blog#show',['id'=>1,'slug'=>'slugsd-idads']);
},'posts.show')->with('id','[0-9]+')->with('slug','([a-z\-0-9]+)');
$router->get('/posts/:id','Blog#show');
$router->post('/posts/:id',function($id){
print_r($_POST); });
$router->run();
$router->get('/posts','Blog#show');
Create new Controller BlogController.php
Files |
File | Role | Description | ||
---|---|---|---|---|
src (2 directories) | ||||
vendor (1 file, 1 directory) | ||||
composer.json | Data | Auxiliary data | ||
index.php | Example | Example script | ||
README.md | Doc. | Documentation | ||
rewriterConfig.php | Aux. | Auxiliary script |
Files | / | src | / | Router |
File | Role | Description |
---|---|---|
Route.php | Class | Class source |
Router.php | Class | Class source |
RouterException.php | Class | Class source |
Files | / | vendor | / | composer |
File | Role | Description |
---|---|---|
autoload_classmap.php | Aux. | Auxiliary script |
autoload_namespaces.php | Aux. | Auxiliary script |
autoload_psr4.php | Aux. | Auxiliary script |
autoload_real.php | Class | Class source |
ClassLoader.php | Class | Class source |
Version Control | Unique User Downloads | |||||||
100% |
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.