的HtmlHelper :: URL和路由器::网址采取任何URL组件,前数组:
$this->Html->url(array('controller' => 'page', 'action' => 'index'));
$this->Html->url($result_array['Result']['results_video']);
或字符串,例如:
$this->Html->url('http://www.google.com');
$this->Html->url($variable['Model']['url']);
可以通到的唯一的事url方法的第二个参数是null或者true,这会将完整的基本url预先设置为由数组组件生成的url,如果为true,那么这不会是您要传递该转义值的位置。
不知道你的$ result_array ['Result'] ['results_video']值究竟是什么,很难说你做错了什么,但我猜你实际上想要的是这个,因为从上下文它看起来像你已经有了一个数组:
<?php
echo $this->Html->link(
$this->Html->image('certificate_image.png'),
$result_array['Result']['results_video'],
array('escape' => false)
);
?>
(请注意,几乎永远不需要回波值到<a>
标签时,你可以使用的HtmlHelper ::链接代替)
提供完全合格网址,它应该工作。换句话说,不要只是通过CakePHP foo.com,确保包含http:// – Kai 2015-01-26 20:54:20