cakephp 中的图像链接不起作用
$this->Html->link(
$this->Html->image('image',array('class' => $class,
'id' =>'img_id' )), somelink, array('onclick' =>'jQuery(this).modal({width:600,height:400,left:120,top:100}).open(); return false;'),
array(),
array('escape'=>false));
它将输出
<a href='link' onclick='jQuery(this).modal({width:600,height:400}).open(); return false;'> < img src='image_path' >
即使我提到 escape=>false,它也不会转义 < 和 >,但我没有得到我失踪的地方?
最佳答案
你们的争论太多了。试试这个:
echo $this->Html->link(
$this->Html->image('image',array('class' => $class,
'id' =>'img_id' )), 'foo', array('escape'=>false, 'onclick' =>'jQuery(this).modal({width:600,height:400,left:120,top:100}).open(); return false;')
);
关于javascript - 图像转义上的 cakephp 链接不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6776484/