Namespace: DafCore Phar: DafCore.phar
$path
"/Users"
"/Accounts/Login"
"/Users/{id}"
the array of ...$callbacks for the minimal api can containe middlewares and the last element is the endpoit.
...$callbacks for the minimal api
new Router(ServicesProvidor $sp, ApplicationContext $context, ViewManager $viewManager)
ServicesProvidor $sp
ApplicationContext $context
ViewManager $viewManager
function Resolve() : void
Only the internal App logic need to use it. [ $app->Run() ]
function SetBasePath(string $path) : void
function AddMiddleware(callable $callback) : void
callback
function AddController(string $controllerClass) : void
[ HttpGet, HttpPost, HttpPut, HttpDelete ]
function Get(string $path, ...$callbacks) : void
GET
function Post(string $path, ...$callbacks) : void
POST
function Put(string $path, ...$callbacks) : void
function Delete(string $path, ...$callbacks) : void
DELETE