Skip to content

Commit

Permalink
mirror updates
Browse files Browse the repository at this point in the history
  • Loading branch information
miladrahimi committed Nov 24, 2019
1 parent 8e29d7c commit bc6d94d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 18 deletions.
15 changes: 3 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ Supported features:

* **v4.x.x (LTS)**
* v3.x.x (Unsupported)

The versions *v2* and *v1* are not available in this repository, please consider an upgrade to the newer versions if you are still using them.
* v2.x.x (Unavailable)
* v1.x.x (Unavailable)

## Installation

Expand Down Expand Up @@ -70,26 +70,17 @@ After the configurations mentioned above, you can start using PhpRouter in your
```php
use MiladRahimi\PhpRouter\Router;
use Zend\Diactoros\Response\JsonResponse;
$router = new Router();
$router->get('/', function () {
return '<p>This is homepage!</p>';
});
$router->post('/blog/post/{id}', function ($id) {
return HtmlResponse("<p>This is a post $id</p>");
});
$router->patch('/json', function () {
return new JsonResponse(["message" => "posted data to user: $id"]);
});
$router->dispatch();
```

There are more examples [here](https://github.com/miladrahimi/phprouter/blob/master/examples/index.php).
There are more examples [here](https://github.com/miladrahimi/phprouter/tree/master/examples).

## HTTP Methods

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "miladrahimi/phprouter",
"description": "PhpRouter is a powerful and standalone HTTP URL router for PHP projects.",
"description": "PhpRouter is a powerful, standalone, and very fast HTTP URL router for PHP projects.",
"keywords": [
"Router",
"URL Router",
Expand Down
5 changes: 0 additions & 5 deletions examples/example-01/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,11 @@
require('../../vendor/autoload.php');

use MiladRahimi\PhpRouter\Router;
use Zend\Diactoros\Response\JsonResponse;

$router = new Router();

$router->get('/', function () {
return '<p>This is homepage!</p>';
});

$router->post('/api/user/{id}', function ($id) {
return new JsonResponse(["message" => "posted data to user: $id"]);
});

$router->dispatch();

0 comments on commit bc6d94d

Please sign in to comment.