douyou1937 2017-05-06 04:04
浏览 26
已采纳

symfony在模态引导程序中加载数据

i need help again, i have my list of products.. and i want to show in a modal bootstrap te details of products... im using symfony 2.8, Yaml, bootstrap and mysql... this is my code

<tbody>
{% for entity in tipoProductos %}
    <tr>
        <td>{{ entity.id }}</td>
        <td>{{ entity.nombre }}</td>
        <td class="hidden-480">{{ entity.abreviacion }}</td>
        <td class="hidden-480">{{ entity.descripcion }}</td>
        <td><span class="label label-sm label-success arrowed arrowed-righ">{{ entity.estado==1?'Habilitado':'Deshabilitado' }}</span></td>
        <td>
            <div class="hidden-sm hidden-xs action-buttons">
                <a class="green" href="#modal-table" role="button" data-toggle="modal"> SHOW </a>
            </div>
            <div id="modal-table" class="modal fade" tabindex="-1">
                <div class="modal-dialog">
                    <div class="modal-content">
                        <div class="modal-header no-padding">
                            <div class="table-header">
                                Tipos de Obra
                            </div>
                        </div>
                        <div class="modal-body no-padding">
                            <table class="table table-striped table-bordered table-hover no-margin-bottom no-border-top">
                                <thead>
                                    <tr>
                                        <th>Nombre</th>
                                        <th>Abreviacion</th>
                                        <th>Descripcion</th>
                                    </tr>
                                </thead>

                                <tbody>
                                    <tr>
                                        <td>{{ entity.nombre}}</td>
                                        <td>{{ entity.abreviacion }}</td>
                                        <td>{{ entity.descripcion}}</td>
                                    </tr>
                                </tbody>
                            </table>
                        </div>
                    </div><!-- /.modal-content -->
                </div><!-- /.modal-dialog -->
            </div>
        </td>
    </tr>
{% endfor %}

I have seen some posts that use only php, but they use a little complex functions, somebody that can help me please. I know it can be done with javascript, which is the best and fastest way to do it .. someone to help me please ...

  • 写回答

1条回答 默认 最新

  • drd2551 2017-05-06 04:11
    关注

    You must put an attribute, and the id of the modal to the link - https://www.w3schools.com/bootstrap/bootstrap_modal.asp

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 unity第一人称射击小游戏,有demo,在原脚本的基础上进行修改以达到要求
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染