[ 'date' => '2011-03-29', 'author' => 'igorw', 'title' => 'Using Silex', 'body' => '...It takes time on version changes...', ], 2 => [ 'date' => '2015-03-29', 'author' => 'igorw', 'title' => 'Using Silex 2', 'body' => '...Especialy S1 to S2...', ], ]; // Default: http://blog, not http://blog/ public function fifiAction(Application $app, $id) { return "
{$post['body']}
"; } // Encode response manually. public function json(Application $app) { return $app->json(static::POSTS); } // Rely on the view handler. public function jsonView() { return static::POSTS; } }