1

MySQL データベースからデータを取得していますが、レンダリングされた TWIG ファイルに表示されません。TWIG ファイルで、Twig の dump() 関数を実行すると、すべてのデータが表示されますが、TWIG は空です。

    $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
    ));
4

1 に答える 1

1

あなたの財産にアクセスするだけです。管理対象エンティティで var_dumpt、print_r、または任意のダンプ関数を使用すると、エンティティの教義とそのすべての依存関係、おそらくコンテナーをダンプしようとするため、php サーバーがクラッシュするか、非常に遅くなる可能性があります...

{{ yorumlar.yourPorpertie }}
于 2013-07-25T14:11:06.630 に答える