-2
私は小さな問題がありますが、私は24の異なるケースでモーダルを使用しなければなりません。このIDをモーダルIDでテストして結果を表示するには、モーダルで。私はよく表現したかどうかわからない!しかし、ここであなたが手動ですべてのあなたの24個のモーダルを作成しているようだコードモーダルで使用するための変数を復帰します
<!-- Modal -->
<?php
$x=7;
$case = $fun -> getCaseByIde($x);
?>
<div id="myModal-<?php echo $x; ?>" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<!-- Modal content-->
<div class="modal-content" style="text-align: center;">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h1><?php echo $x; $case['titre']; ?></h1>
</div>
</div>
</div>
</div>
<!-- #END# Modal -->
<!-- Modal -->
<?php
$x=8;
$case = $fun -> getCaseByIde($x);
?>
<div id="myModal-<?php echo $x; ?>" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<!-- Modal content-->
<div class="modal-content" style="text-align: center;">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h1><?php echo $x; $case['titre']; ?></h1>
</div>
</div>
</div>
</div>
<!-- #END# Modal -->
<!-- Modal -->
<?php
$x=9;
$case = $fun -> getCaseByIde($x);
?>
<div id="myModal-<?php echo $x; ?>" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg">
<!-- Modal content-->
<div class="modal-content" style="text-align: center;">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h1><?php echo $x; $case['titre']; ?></h1>
</div>
</div>
</div>
</div>
<!-- #END# Modal -->
英語でお願いします。 – aynber
こんにちは、私は小さな問題がある、私は24の異なるケースのためにモーダルを使用しなければならない、私はモーダルIDでこのidをテストし、モーダルに結果を表示するモーダルに入る前にIDを取得する必要があります。私はよく表現したかどうかわからない!しかしここにコードがあります –
コメントとして追加するのではなく、より良い概観のためにあなたの追加情報をあなたの質問に編集してください;) – BenRoob