1

I'm getting datas from MySQL database but not display in rendered TWIG file. in TWIG file, I execute Twig's dump() function It works, all datas displayed but TWIG is empty.

    $em = $this->getDoctrine()->getEntityManager();
    $yorumlar = $em->getRepository('SiteSiteBundle:Yorum')->find($id);

    if (!$yorumlar) {
        throw $this->createNotFoundException($id . ' nolu Yorum bulunamadı!');
    }

    return $this->render('SiteSiteBundle:Default:liste.html.twig', array(
                'yorumlar' => $yorumlar
    ));
1
  • Can you post the code from your twig file? Commented Jul 25, 2013 at 14:08

1 Answer 1

1

Just acces to your propertie. Using var_dumpt, print_r or any dump function in a managed entity could crash or marke verry slow you php server because it will try to dump you entity doctrine and all his dependancies maybe the container...

{{ yorumlar.yourPorpertie }}
Sign up to request clarification or add additional context in comments.

1 Comment

this is works. it was single data. single row data doesn't need FOR statement.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.