Html helper img src and class

Ok original code in listview prior to helper:

$linev = '';
 $elink = DIR . "dog/view?dogid={$row->dogid}";
 $linev = "<td class=\"imgtd\"><a href=" . $elink . ">";
 $linev = $linev . '<img src="' . "../webroot/" . 'upload/imgdogs/' . $row->dogpic . '" alt="" class="image"></a></td>';
 echo $linev;

This opens a view / detailed page and works. the url looks like


Now the code I attempted, docs didn’t show a complete example of an image with link with class applied

                    echo '<td>';
                    echo $this->Html->link(
                            $this->Html->image('imgdogs/' . $row->dogpic, array(
                                'class' => 'image',
                                'alt' => ''
                            )), array(
                        'controller' => 'Dogs',
                        'action' => 'view', '?dogid=' . $row->dogid
                            ), array(
                        'class' => 'imgtd',
                        'escape' => false //to allow the image tag within the link
                    echo '</td>';

which works, but the view page has this for url


A slash to right of view and %3F and %3D. How do I use helper yet have this


I am fairly new to cakephp, but not php. I have also used laravel in past.

Note, found example on stackoverflow.

echo $this->Html->link('View image', [
    'controller' => 'Images',
    'action' => 'view',     
    '?' => ['height' => 400, 'width' => 500]

Ok thanks, I saw it it docs, but it didn’t catch me. this line did the trick

'?' => ['height' => 400, 'width' => 500]

Just changed to

'?' => ['dogid' => $row->dogid]

A followup, I have the images in


any idea how to call them if folder was


in app.php there is
'imageBaseUrl' => 'img/', just modify it to your needs

yeah sometimes things are mentioned only once in docs so it can be hard to catch