Doctrine 实体管理器导致页面中断

Doctrine entity manager causing page to break

我是 Symfony2 的新手,正在尝试显示列出实体项目的页面。但是,一旦我使用带有 "No data received error" 或 "ERR_EMPTY_RESPONSE" 的分页符下方的代码,让我认为我的路线不起作用并提出问题 但问题与 Doctrine 有关:

    public function indexAction() {
    $em = $this->getDoctrine()->getManager();

    $entities = $em->getRepository('ApsaBundle:Apsa')->findAll();

    return $this->render('ApsaBundle:Apsa:index.html.twig', array(
                'entities' => $entities,
    ));

但是,这个简单的函数显示页面:

    public function indexAction() {
             return $this->render('ApsaBundle:Apsa:index.html.twig');
   }

我很高兴知道如何调试这个原则issue.Below 用于显示页面的树枝

{% extends ::base.html.twig %}
{% block body -%}
    Apsa list

    <table class="records_list">
        <thead>
            <tr>
                <th>Id</th>
                <th>Titre</th>
                <th>Description</th>
                <th>Actions</th>
            </tr>
        </thead>
        <tbody>
        {% for entity in entities %}
            <tr>
                <td><a href="#">{{ entity.id }}</a></td>
                <td>{{ entity.titre }}</td>
                <td>{{ entity.description }}</td>
                <td>
                <ul>
                    <li>
                        <a href="#">show</a>
                    </li>
                    <li>
                        <a href="#">edit</a>
                    </li>
                </ul>
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>

        <ul>
        <li>
            <a href="#">
                Create a new entry
            </a>
        </li>
    </ul>
    {% endblock %}

能否找到 link 压缩项目 here

可能是由于错误的 WAMP 配置。

我邀请您尝试使用此命令行提供的内置 symfony 服务器:

php app/console server:run