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
http://localhost/cakephp/dog/view?dogid=91
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
http://localhost/cakephp/dogs/view/%3Fdogid%3D91
A slash to right of view and %3F and %3D. How do I use helper yet have this
http://localhost/cakephp/dog/view?dogid=91
I am fairly new to cakephp, but not php. I have also used laravel in past.
Note, found example on stackoverflow.