Releases: oscarpalmer/numidium
Releases · oscarpalmer/numidium
0.19.0
- A little refactoring of class names to be more specific, e.g.,
Resource
->ResourceController
Dependencies
-class has been moved to routing items folder
0.18.0
Resources! A custom route, of sorts, allowing you to quickly add routes matching specific paths and http methods for managing data. Somewhat inspired by Rails' route building, but with standard-y HTTP methods and nicer URLs, in my opinion.
Using the code below:
$numidium->resources(function (oscarpalmer\Numidium\Routing\Items\Resources $resources) {
$resources->add('users', UserController::class);
});
Will result in routes matching:
[GET, HEAD] /users A route for showing all users
[GET, HEAD] /users/#id A route for showing a user
[GET, HEAD] /users/#id/edit A route for showing a form for editing a user
[POST] /users/create A route for creating a new user
[POST] /users/#id/remove A route for removing a user
[POST] /users/#id/update A route for updating a user
While your class must inherit oscarpalmer\Numidium\Controllers\Resource
to then properly respond to all these routes.
0.17.0
- Minor refactoring
- During controller matching:
- Simple paths –
/path
– will try to matchpath::handle
anddefault::path
, in that order- ... where
default
is the default controller class, andhandle
is aPSR-15
-compliant method
- ... where
- Nested paths –
/a/nested/path
– will try to matcha\nested::path
anda\nested\path::handle
, in that order- ... where
handle
is aPSR-15
-compliant method
- ... where
- Simple paths –
0.16.0
Tests added for just about everything…
0.15.0
- Configuration split into manager and validator-classes
- JSON response helper
0.14.0
- Controller matching for routes
- If there are no existing routes, Numidium will try to find a controller (and method) based on path:
- e.g.
a/nested/route
will try to match (in order):- class
A\Nested\Route
and methodhandle
(like a PSR request handler) - class
A\Nested\Route
and methodindex
- class
A\Nested
and methodroute
- class
- e.g.
- Configuration options added for controllers:
controller_prefix
for controller namespace- e.g.
/a/nested/route
should matchControllerPrefix\A\Nested\Route
instead ofA\Nested\Route
- e.g.
default_controller
for defining a controller to handle root routes- e.g.
/a
matches classA
and classDefaultController
(with methoda
)
- e.g.
- If there are no existing routes, Numidium will try to find a controller (and method) based on path:
- Error exception class added for creating error responses
- Float values are now handled by parameters
0.13.0
- Support for PSR-middleware
- Removed support for outputting objects, i.e. encoding objects with JSON
- Improved path handling
- Added documentation (in code) for most public methods
0.12.0
0.11.0
- Route and Error now extend the RequestHandlerInterface
- Improved handling of Route and Error callbacks
0.10.0
- Callbacks for routes and error now only accept closures and strings
- Default headers added as configuration item
- Parameters object has been extended with url query values and url fragment