Knp\Bundle\KnpBundlesBundle\Controller\OrganizationController::showAction PHP Method

showAction() public method

public showAction ( Request $request, $name )
$request Symfony\Component\HttpFoundation\Request
    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));
    }