我有一个自动模式,可以点击按钮弹出。但是,只要我将一个表添加到此模式以显示项目列表,该表就会显示没有单击该按钮的情况。整个视图变得搞砸了。我该如何解决这个问题?
我的观点:
<button type="button" class="btn btn-info btn-lg" data-toggle="modal" data-target="#myModal">Open Modal</button>
<!-- Modal -->
<div id="myModal" class="modal fade" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Modal Header</h4>
</div>
<div class="modal-body">
<table class="table table-bordered">
<thead>
</thead>
<tbody>
<?php $contacts = \Vanguard\Libraries\Utilities::getContactPersons($project->id); ?> @if(isset($contacts)) @foreach($contacts as $contact)
<tr>
<td>{{$contact->contact_name}}</td>
<td>{{$contact->contact_phone_number}}</td>
<td>{{$contact->contact_email}}</td>
</tr>
@endforeach @endif
</tbody>
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>
</div>
</div>