przewiń do treści

Symfony 2 od podstaw

Włodzimierz Gajda

/**
 * Lista rekordow user
 *
 * @Route("/")
 * @Template()
 */
public function indexAction()
{
    $em = $this->getDoctrine()->getEntityManager();
    $entities = $em->getRepository('MyFrontendBundle:User')->findAll();
    return array('entities' => $entities);
}

Listing 31.11. Kod akcji index

Rozdział 31. Relacje 1:1

listing-31-11.txt

Reklama

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