blank-framework/minimal-kernel

Small minimalistic kernel for handling requests

v1.0.0 2023-11-17 20:28 UTC

This package is auto-updated.

Last update: 2024-09-29 06:29:22 UTC


README

MinimalKernel can be used to map HTTP request methods to the corresponding function in a controller class. All functionality needs to be handled in the controller.

Required packages

This component uses symfony/http-foundation to handle the request and response elements.

The controller

All controllers that you want to use with the Kernel MUST implement the MinimalControllerInterface. The interface contains a function for each of the HTTP Methods. Your functions should return a Response class if they are implemented and EITHER null or a Response class that uses the 405 Method Not Allowed HTTP response status code. If you return null MinimalKernel will throw an \Exception thus you MUST handle that or let it throw should you choose.