有没有办法修改数据表,例如过滤信息?

时间:2019-09-12 11:50:14

标签: php datatable datatables doctrine symfony-2.8

实际上,我有一个html.twig文件,其中有下一个数据表:

--------------------------------------
审核|区域
--------------------------------------
1 | Area1
2 | Area1
3' Area1
4' Area1
5 | Area2
6 Area2
7。 Area2
8个| Area2
--------------------------------------
Screen shot of the Current Datatable
但是我想要做的就是以这种方式显示数据表:
--------------------------------------
审核|区域
--------------------------------------
1、2、3、4 | Area1
5、6、7、8 | Area2
--------------------------------------

这是我在控制器中获取信息的方式:

$em = $this->getDoctrine()->getEntityManager();

        $auditsByAuditor = $em->getRepository('FSABundle:FsaAudits')
                            ->findBy(array('idAuditor'=>$auditor->getId()));


        return $this->render('FSABundle:FsaAudits:FsaPlan.html.twig', array(
            'currentPlan' => $currentPlan,
            'auditsByAuditor' => $auditsByAuditor
        ));

这就是我的 html.twig:

<div class="table-responsive">
                <br/>
                {% for message in app.session.flashbag().get('status') %}
                    <div class="alert alert-success">{{message}}</div>
                    {%endfor%}
                    <table aria-describedby="dataTable_info" cellspacing="0" class="table table-hover dataTable" id="dataTable" role="grid" style="width:100%;" width="100%">
                        <thead>
                            <tr>
                                <th>Auditorias</th>
                                <th>Areas</th>
                            </tr>
                        </thead>
                        <tbody>
                            {% for audit in auditsByAuditor %}
                                <tr>
                                    <td>{{ audit.idAudit }}</td>
                                    <td>{{ audit.idArea}}</td>
                                </tr>
                            {% endfor %}
                        </tbody>
                    </table>
                </div>


是否有任何想法或建议?

0 个答案:

没有答案