Dear Slim Team
Let’s assume a simple route like this:
$app->post('/ticket/new', function (Request $request, Response $response) use ($cfgAPI) {
doing stuff here
$response->getBody()->write("we are done");
return $response;
});
If I put in some conditional logic inside this route - what is the best practice to exit if some condition is reached?
simple condition
if ($a == “yes”) {
$response->getBody()->write(“done case yes”);
return $response;
} else {
$response->getBody()->write(“done case no”);
return $response;
}
But if I have more complex conditions, the following way would be nice - but is this allowed/supported? I saw halt/stop is removed in V3:
if ($a == "yes") {
$response->getBody()->write("done case yes");
return $response;
AND DO NOT PROCESS FURTHER exit/halt/stop here
}
…and more logic…
…and more logic…
Sorry, but I can’t find this in the docs.
Thanks for helping out!
andi