przewiń do treści

Symfony 2 od podstaw

Włodzimierz Gajda

class DefaultController extends Controller
{

    /**
     * @Route("/")
     * @Template()
     */
    public function indexAction()
    {
        $em = $this->getDoctrine()->getEntityManager();

        $entities = $em->getRepository('MyFrontendBundle:River')->findAll();

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

}

Listing 18.13. Kod akcji index

Rozdział 18. ORM Doctrine 2

listing-18-13.txt

Reklama

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