php - 有没有办法修改数据表,比如过滤信息?
问题描述
实际上我有一个 html.twig 文件,其中有下一个数据表:
--------------------------------------------------
审计 | 领域
--------------------------------------
1 | 区域
1 2 | 区域
1 3 | 区域
1 4 | 区域
1 5 | 区域
2 6 | 2区
7 | 2区
8 | Area2
--------------------------------------
当前数据表的屏幕截图
但是我想要什么要做的就是以这种方式显示数据表:
--------------------------------------
Audits | 地区
--------------------------------------
1, 2, 3, 4 | 区域
1 5, 6, 7, 8 |
区域2 --------------------------------------
这就是我在控制器中获取信息的方式:
$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>
关于如何制作它的任何想法或建议?
解决方案
推荐阅读
- angular - JWT Helper 服务在 Angular 10 中引发错误
- php - 如何让数据允许小数
- python - 如何并行写入numpy数组中的同一单元格?
- powershell - 如何在 PowerShell 的脚本块中运行模块?
- python - 合并两个动画条形图 Plotly
- java - 通过 HtmlUnit 下载 CSV 并读入数组
- ios - 将 AudioKit v5 添加为 Swift 包后无法分发存档
- algorithm - 调度和路由优化
- rabbitmq - 多路复用 RabbitMQ 消息
- python - Google API:网址不匹配:flow.redirect_uri 被忽略