Hello,
Is it possible to pass object to finish method of Micro app.
Let's say , we have this POST method
$app->post("/wsd" , function() use($app){
$car= new Car();
//===> I want to send $car to finish method.
}
)->setName("createCar");
And Here my finish method
$app->finish(
function () use ($app) {
if($app->getRouter()->getMatchedRoute() != null ){
$route_name = $app->getRouter()->getMatchedRoute()->getName();
if($route_name == "createCar" || ){
// I want to get my car object here.
}
}
}
Thanks for your answer !
Mehdi