-
-
Notifications
You must be signed in to change notification settings - Fork 46
Changelogs
İzni Burak Demirtaş edited this page Jan 23, 2022
·
6 revisions
-
IMPORTANT - Added
notFound
method instead oferror
method. From now on,error
method will be used to handle exceptions and be able to return a pretty response you desire to client. - Added
XGET
request method instead ofAJAX
.AJAX
request method will be deprecated in next releases. - Added
__invoke
method support for Controllers- From now on, you can use the Controller which only contain
__invoke
method. You can define a route with such a that controller:For details, please check the Wiki page.$router->get('/foo', 'FooController');
- From now on, you can use the Controller which only contain
- And some refactoring...
- Fixed issue related with regex for running path.
- Updated error function to handle Not Found errors better. Now, you can use Request and Response instances in Closure parameters:
$router->error(function(Request $request, Response $response) {
$response->setStatusCode(Response::HTTP_NOT_FOUND);
$response->setContent('Oops! Page not found!');
return $response;
});
- Fixed issue related with server path.
Some improvements:
- Changed namespace and directory structure. You must use
Buki\Router\Router
class instead ofBuki\Router
in order to create new Router instance. Please check documentation for more. - The same middleware has been prevented from running twice.
A lot of updates and code optimization has been made for PHP-Router and released v2.0.0. For this version:
- Added and enhanced Request and Response support by using
symfony/http-foundation
package. - Middleware usage was enhanced.
- Added base Controller and Middleware classes.
- Changed minimum PHP version as
^7.2.5
. - Code optimizations...