在为输出生成的链接编写回显时,我可能制造了一个怪物 :( 我不明白在使用 HtmlHelper 时如何连接所有这些参数。我读了两次关于它的文章,但没有明白。
我的代码是:
echo "<a href=\"/img/filmography/" . $movie['Film']['frameset'] .
"_frame_" . $i . ".jpg\"" . "rel=\"lightbox[" . $movie['Film']['id'] .
"]\"" . " title=\"\">"
. "<img src=\"/img/filmography/thumb/" . $movie['Film']['frameset'] .
"_frame_" . $i . ".jpg\"" . "alt=\"pic from " . $movie['Film']['title'] .
"\"" . "/></a>";
我想在 HTML 中实现的目标:
<a href="/img/filmography/movie_frame_1.jpg" rel="lightbox[1]" title="">
<img src="/img/filmography/thumb/movie_frame_1.jpg"
alt="pic from some movie"/>
</a>