
現在、プログラミングを学習している初心者です。
CakePHP3.5でオリジナルグルメランキングアプリを作っているのですが、
ランキングページ→個別食事の紹介ページへどのように画像をリンクさせるかわかりません。
画像で表示させることはできました。
- index.ctp <h1>北関東グルメ</h1> <hr> <ul class="side-nav"> <!--home画面--> <li class="heading"><?= $this->Html->link(__('ホーム'), ['controller'=>'Ranking', 'action'=>'index']) ?></li> <li class="heading"><?= $this->Html->link(__('北関東グルメとは'), ['controller' => 'information', 'action' =>'index']) ?></li> <li class="heading"><?= $this->Html->link(__('グルメ一覧'), ['controller' => 'Foods', 'action' => 'index'])?></li> <li class="heading"><?= $this->Html->link(__('観光スポット一覧'), ['controller' => 'Spots', 'action' => 'index']) ?></li> </ul> <h1>県別ランキング</h1> <hr> <!--ranking画面--> <?php foreach ($foods as $food): ?> <tr> <h1><td><?= h($food->prefecture) ?></td></h1> <h3><td><?= h($food->name) ?></td></h3> <tr> <?=($this->Html->image($food->imgURL, array('width'=>'500','height'=>'266', ['alt' => '北関東'])));?> <td><?= h($food->title) ?></td> <td><?=h($food->price)?></td> </tr> <?php endforeach; ?>


回答1件
あなたの回答
tips
プレビュー