0
如何在Slim中寫入數組輸出?Slim Framework - 如何輸出沒有模板的數組?
$app->get('/', function ($request, $response, $args) {
$array = ['message' => 'Hello World'];
$response->getBody()->write($array);
return $response;
});
錯誤:
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
我只想陣列輸出到屏幕上沒有任何模板,也沒有JSON。可能嗎?