Listing 27.2. Kod akcji show
/**
 * @Route("/{slug}.html", name="song_show")
 * @Template()
 */
public function showAction($slug)
{
    $em = $this->getDoctrine()->getEntityManager();
    $entity = $em->getRepository('MyFrontendBundle:Song')->findOneBySlug($slug);

    if (!$entity) {
        throw $this->createNotFoundException('Podana strona nie istnieje!');
    }

    return array('entity' => $entity);
}