Skip to content

Releases: gigili/PHP-routing

v3.1.7

22 Aug 19:17
72e2879
Compare
Choose a tag to compare
  • 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

04 May 19:57
Compare
Choose a tag to compare

Full Changelog: v3.1.5...v3.1.6

v3.1.5

04 May 19:49
Compare
Choose a tag to compare

Full Changelog: v3.1.4...v3.1.5

v3.1.4

04 May 19:41
Compare
Choose a tag to compare

Full Changelog: v3.1.3...v3.1.4

v3.1.3

04 May 19:25
Compare
Choose a tag to compare

Add getAllData method which returns all body arguments from a request.

Full Changelog: v3.1.2...v3.1.3

v.3.1.2

04 May 09:59
Compare
Choose a tag to compare

Full Changelog: v3.1.1...v3.1.2

v3.1.1

01 Jun 06:31
Compare
Choose a tag to compare
  • [FIX] Add support for Response class to be added as a default callback argument just like Request class is

Full Changelog: v3.1.0...v3.1.1

v3.1.0

20 Apr 08:19
Compare
Choose a tag to compare

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

07 Apr 21:12
Compare
Choose a tag to compare

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

29 Sep 16:20
Compare
Choose a tag to compare

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