title: CakePHP: image inside link, want to make link point to image location
body: <p>I have some images inside links that I want to essentially look like this:</p>
  
  <pre><code>&lt;a href="/path/to/img.png"&gt;&lt;img src="/path/to/img.png" /&gt;&lt;/a&gt;
  </code></pre>
  
  <p>Clicking on the link should load the image it contains. I'm trying to use CakePHP's HTML helper to do this, as follows:</p>
  
  <pre><code>&lt;?php
    echo $html-&gt;link(
      $html-&gt;image('img.png'),
      'img.png',
      array('escape' =&gt; false)
    );
  ?&gt;
  </code></pre>
  
  <p>When I do this, however, I get the following code:</p>
  
  <pre><code>&lt;a href="/pages/img.png"&gt;&lt;img src="/path/to/img.png" /&gt;&lt;/a&gt;
  </code></pre>
  
  <p><strong>Without using absolute URLs</strong>, can I make the link's <code>href</code> attribute point to the image's correct location?</p>
  
  <p>Thanks!</p>