Image Cakephp将图像链接到外部站点

Image Cakephp将图像链接到外部站点,image,cakephp,hyperlink,Image,Cakephp,Hyperlink,刚接触cakephp时,我尝试制作一个链接到外部站点的图标,我尝试浏览烹饪书和一些论坛,但我似乎找不到我想要的 以下是我当前的代码: echo $this->Html->link($this->Html->image('ex_vi.png', array('height' => '40', 'width' => '40')) . '' . ('Example'), array('http://examples.com'), array('escape' =&g

刚接触cakephp时,我尝试制作一个链接到外部站点的图标,我尝试浏览烹饪书和一些论坛,但我似乎找不到我想要的

以下是我当前的代码:

echo $this->Html->link($this->Html->image('ex_vi.png', array('height' => '40', 'width' => '40')) . '' . ('Example'), array('http://examples.com'), array('escape' => false));

感谢您的帮助,第一次使用框架编写代码时有点沮丧,一切都完全不同

您可以使用以下代码向图像添加外部链接

echo$this->Html->link($this->Html->image('ex_vi.png',数组('height'=>'40','width'=>'40'))。'('Example'),'http://examples.com,数组('escape'=>false))


只需不使用数组直接传递URL即可

您可以使用以下代码向图像添加外部链接

echo$this->Html->link($this->Html->image('ex_vi.png',数组('height'=>'40','width'=>'40'))。'('Example'),'http://examples.com,数组('escape'=>false))

只需直接传递URL而无需数组