Skip to content

Commit cb8d416

Browse files
author
F.Michel
committed
composer update and change readme
1 parent 94ae642 commit cb8d416

File tree

2 files changed

+259
-242
lines changed

2 files changed

+259
-242
lines changed

README.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,13 @@ try {
9999
```
100100
How to Define Route methods
101101
```php
102-
new \DevCoder\Route('api_articles_post', '/api/articles', [ArticleController::class, 'post'], ['POST']);
103-
new \DevCoder\Route('api_articles_put', '/api/articles/{id}', [ArticleController::class, 'put'], ['PUT']);
102+
$route = new \DevCoder\Route('api_articles_post', '/api/articles', [ArticleController::class, 'post'], ['POST']);
103+
$route = new \DevCoder\Route('api_articles_put', '/api/articles/{id}', [ArticleController::class, 'put'], ['PUT']);
104+
/**
105+
* ---- OR -----
106+
*/
107+
$route = \DevCoder\Route::post('api_articles_post', '/api/articles', [ArticleController::class, 'post']);
108+
$route = \DevCoder\Route::put('api_articles_put', '/api/articles/{id}', [ArticleController::class, 'put']);
104109
```
105110
Generating URLs
106111
```php

0 commit comments

Comments
 (0)