public function showAction(Request $request, $name)
{
$format = $request->getRequestFormat();
/* @var $organization Organization */
if (!($organization = $this->getRepository('Organization')->findOneByNameWithRepos($name))) {
if ('json' === $format) {
return new JsonResponse(array('status' => 'error', 'message' => 'Organization not found.'), 404);
}
throw new NotFoundHttpException(sprintf('The organization "%s" does not exist', $name));
}
if ('json' === $format) {
return new JsonResponse($organization->toSmallArray());
}
$this->highlightMenu('organizations');
return $this->render('KnpBundlesBundle:Organization:show.html.twig', array('organization' => $organization));
}