Q:

How to write this code with cakephp 2.2.1 html helper?

I probably made a monster when writing an echo for outputting generated links :( I don't understand how to concatenate all this params when using HtmlHelper. I read article about it twice but don't get it.
My code is:
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>";

What I want to achieve in 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>

A:

I think, this will do for you..
$path = sprintf("/filmography/thumb/%s_frame_%s.jpg", $movie['Film']['frameset'], $i);
echo $this->Html->link($this->Html->image($path, array(    "alt" => "pic from " . $movie['Film']['title'])) , '/img/filmography/'. $movie['Film']['frameset'] . '_frame_' . $i . '.jpg',  array('escape' => false, 'rel' => 'lightbox[' . $movie['Film']['id'] . ']'));

