Releases: gigili/PHP-routing
v3.1.7
- Added support for optional parameters
- Added more tests
- Updated documentation in doc blocks
Optional parameters
$routes->add(
'/demo/{id?}',
function($id = 'defaultValue'){
echo "ID: . $id";
},
Routes::GET
);
When calling this endpoint with /demo
it will output ID: defaultValue
and with /demo/123
it will output ID: 123
Full Changelog: v3.1.6...v3.1.7
v3.1.6
Full Changelog: v3.1.5...v3.1.6
v3.1.5
Full Changelog: v3.1.4...v3.1.5
v3.1.4
Full Changelog: v3.1.3...v3.1.4
v3.1.3
Add getAllData
method which returns all body arguments from a request.
Full Changelog: v3.1.2...v3.1.3
v.3.1.2
Full Changelog: v3.1.1...v3.1.2
v3.1.1
- [FIX] Add support for
Response
class to be added as a default callback argument just likeRequest
class is
Full Changelog: v3.1.0...v3.1.1
v3.1.0
With the creation of Response
class, it will allows us to better handle different values for request and response data.
Deprecation notices
In the Request
class the following method will now receive deprecation notices but will still function as before without any breaking changes. But with the release of v4 it is expected that these methods will be removed entirely.
What's Changed
Full Changelog: v3.0.10...v3.1.0
v3.0.10
New:
- Added support for creating OPTIONS routes
Fixed:
- Added fallback support for fetching request headers
Full Changelog: v3.0.9...v3.0.10
v3.0.9
What's Changed
Example:
# In your routes
$roues->get("/activate/{code}", [Controller::class, "method", ["injected_value" => "test"])->save();
#In your controller
class Controller {
public function method(Request $request, string $code, string $injected_value){
//$code => would get the value from the url
//$injected_value => would get the value from the 3rd argument in routes setup ("test")
}
}
Full Changelog: v3.0.8...v3.0.9