御世話になります。
bake 自動生成によってできた以下 foreach 文に for を設定したいと思います。
cakephp3
1 <?php foreach ($transactionss[0] as $transaction): ?> 2 <tr> 3 <td><?= $this->Number->format($transaction->id) ?></td> 4 <td><?= $this->Number->format($transaction->orderid) ?></td> 5 <td><?= h($transaction->item->name) ?></td> 6 <td><?= h($transaction->item->amount) ?></td> 7 <td><?= h($transaction->customername) ?></td> 8 <td><?= h($transaction->customeremail) ?></td> 9 <td><?= h($transaction->customeraddress) ?></td> 10 <td><?= h($transaction->item->shop->user->email) ?></td> 11 <td><?= h($transaction->modified) ?></td> 12 </tr> 13<?php endforeach; ?>
$transactionss[0]には、変数「$i」を入れる予定です。
htmlタグの関係で、普通に囲ってもエラーになり、どのような組み込み方をすればよいかわかりません。
上記のコードをベースに、for 文で、三回繰り返す例を頂けると大変助かります。
よろしくお願いします。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。