I\'m using cakephp 2.3.0. I searched in the manual for quite awhile, but I haven\'t found the answer. I\'m trying to use $this->Html->link, along with $this->Html->image. I\'m t
echo $this->Html->image('imagename',array('alt'=>'myimage','class'=>'img-responsive'));
This is normal image without any link, now to wrap it with link tag use
echo $this->Html->link($this->Html->image('imagename',array('alt'=>'myimage', 'title'=>'myimage','class'=>'img-responsive')), [
'controller' => 'controllerName',
'action' => 'actionName',
'id' => $value['id'], //if any parameters are passed
],['escape' => false]);
Similarly you can assign the image tag to a variable and use it
$myImageVar = $this->Html->image('imagename',array('alt'=>'myimage','class'=>'img-responsive'));
echo $this->Html->link($myImageVar, [
'controller' => 'controllerName',
'action' => 'actionName',
'id' => $value['id'], //if any parameters are passed
],['escape' => false]);