Wie kann ich Array-Ausgaben in Slim schreiben?Slim Framework - wie Arrays ohne Vorlagen ausgeben?
$app->get('/', function ($request, $response, $args) {
$array = ['message' => 'Hello World'];
$response->getBody()->write($array);
return $response;
});
Fehler:
Slim Application Error The application could not run because of the following error:
Details
Type: RuntimeException Message: Could not write to stream File: /var/www/slim/vendor/slim/slim/Slim/Http/Stream.php Line: 407
Ich möchte nur das Ausgangsfeld auf dem Bildschirm ohne Vorlagen, noch json. Ist es möglich?