public function getSlimView(\Slim\Http\Request $request) { if ($request->isAjax() || $request->isXhr() || $request->get('format', '') == 'json' || $request->post('format', '') == 'json') { return $this->slimViewFactory->getJsonSlimView(); } return $this->slimViewFactory->getHtmlSlimView(); }