przewiń do treści

Symfony 2 od podstaw

Włodzimierz Gajda

/**
 * @Route("/", name="homepage")
 * @Template()
 */
public function indexAction()
{
    $em = $this->getDoctrine()->getEntityManager();
    $entities = $em->getRepository('MyFrontendBundle:Song')->findAll();
    return array('entities' => $entities);
}

Listing 26.6. Kod akcji index

Rozdział 26. Akcja show

listing-26-06.txt

Reklama

Szkolenia z Symfony 2.1
©2012 Włodzimierz Gajda
ver. 1.0.1