2011-07-21 53 views
0

图片链路不工作cakephp的链路不工作在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;'> &lt; img src='image_path' &gt; 

它不逸出& lt和>即使我提到逃逸= >假,但我没有得到我失踪的地方?

回答

2

你有太多的争论。试试这个:

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;') 
); 
+0

在这里阅读API:http://api.cakephp.org/class/html-helper#method-HtmlHelperlink –

+0

@马特布思曼:感谢您的帮助和建议。 – pushpa

+0

所以我的回答解决了你的问题? –

1
echo $this->Html->link( 
$this->Html->image('image',array('class' => $class, 
     'id' =>'img_id')), '#', array('escape'=>false, 'onclick' => 'jQuery(this).modal({width:600,height:400,left:120,top:100}).open(); return false;','class'=>'linkclass'));