Sonata\ProductBundle\Controller\CollectionController::viewAction PHP Method

viewAction() public method

Display one collection.
public viewAction ( $collectionId, $slug ) : Response
$collectionId
$slug
return Response
    public function viewAction($collectionId, $slug)
    {
        $collection = $this->get('sonata.classification.manager.collection')->findOneBy(array('id' => $collectionId));
        if (!$collection) {
            throw new NotFoundHttpException(sprintf('Unable to find the collection with id=%d', $collectionId));
        }
        return $this->render('SonataProductBundle:Collection:view.html.twig', array('collection' => $collection));
    }