Skip to content

Commit

Permalink
Versions: open 5.1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
f3l1x committed Nov 17, 2023
1 parent 717263a commit 7eba9a0
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 14 deletions.
20 changes: 11 additions & 9 deletions .docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,7 @@ If you don't want to create route with DELETE method, simply remove the `UsersPr
```php
namespace App;

use Nette;
use Nette\Application\Routers\RouteList;
use Nette\Application\Routers\Route;
use Contributte\ApiRouter\ApiRoute;
use Contributte\ApiRouter\ApiRoute;use Nette;use Nette\Application\Routers\Route;use Nette\Application\Routers\RouteList;

class RouterFactory
{
Expand All @@ -135,23 +132,28 @@ class RouterFactory
* POST => UsersPresenter::actionCreate()
*/
$router[] = new ApiRoute('/hello', 'ApiRouter', [
'methods' => ['GET' => 'superRead', 'POST']
'methods' => ['GET' => 'superRead', 'POST'],
]);

$router[] = new ApiRoute('/api-router/api/users[/<id>]', 'Resources:Users', [
'parameters' => [
'id' => ['requirement' => '\d+', 'default' => 10]
'id' => ['requirement' => '\d+', 'default' => 10],
],
'priority' => 1
'priority' => 1,
]);

$router[] = new ApiRoute('/api-router/api/users/<id>[/<foo>-<bar>]', 'Resources:Users', [
'parameters' => [
'id' => ['requirement' => '\d+']
'id' => ['requirement' => '\d+'],
],
'priority' => 1
'priority' => 1,
]);

# Disable basePath detection
$route = new ApiRoute('/api-router/api/users', 'Resources:Users');
$route->setAutoBasePath(false);
$router[] = $route;

$router[] = new Route('<presenter>/<action>', 'Homepage:default');

return $router;
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ For details on how to use this package, check out our [documentation](.docs).

## Versions

| State | Version | Branch | Nette | PHP |
|--------|----------|----------|--------|---------|
| dev | `^5.0.0` | `master` | `3.0+` | `>=8.0` |
| stable | `^4.3.0` | `master` | `3.0+` | `>=7.1` |
| State | Version | Branch | Nette | PHP |
|--------|---------|----------|--------|---------|
| dev | `^5.1` | `master` | `4.0+` | `>=8.1` |
| stable | `^5.0` | `master` | `3.1+` | `>=8.1` |

## Development

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "5.0.x-dev"
"dev-master": "5.1.x-dev"
}
}
}

0 comments on commit 7eba9a0

Please sign in to comment.