Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/70.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql Symfony2 doctrine2数组数据可用,可在细枝文件中工作,但呈现为空白页_Mysql_Symfony_Twig - Fatal编程技术网

Mysql Symfony2 doctrine2数组数据可用,可在细枝文件中工作,但呈现为空白页

Mysql Symfony2 doctrine2数组数据可用,可在细枝文件中工作,但呈现为空白页,mysql,symfony,twig,Mysql,Symfony,Twig,我从MySQL数据库中获取数据,但不显示在渲染的细枝文件中。在TWIG文件中,我执行TWIG的dump()函数,该函数起作用,显示所有数据,但TWIG为空 $em = $this->getDoctrine()->getEntityManager(); $yorumlar = $em->getRepository('SiteSiteBundle:Yorum')->find($id); if (!$yorumlar) { throw

我从MySQL数据库中获取数据,但不显示在渲染的细枝文件中。在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
    ));

只是随便看看你的财产。在托管实体中使用var_dumpt、print_r或任何dump函数都可能会使php服务器崩溃或变慢,因为它会尝试转储您的实体条令及其所有依赖项,可能是容器

{{ yorumlar.yourPorpertie }}

只是随便看看你的财产。在托管实体中使用var_dumpt、print_r或任何dump函数都可能会使php服务器崩溃或变慢,因为它会尝试转储您的实体条令及其所有依赖项,可能是容器

{{ yorumlar.yourPorpertie }}

你能从你的小枝文件中发布代码吗?你能从你的小枝文件中发布代码吗?这很有效。这是单一数据。语句不需要单行数据。这是可行的。这是单一数据。语句不需要单行数据。