2014-01-08 276 views
0

下面的代碼中插入圖像中不工作的鏈接標籤

<?php echo $this->Html->link($this->Html->image('ilmelogo.png'),array('controller'=>'pages','action'=>'feedback')); ?> 

但此代碼工作。幫我出

<?php echo $this->Html->image('ilmelogo.png'); ?> 
+0

<?PHP $鏈接= $這個 - > HTML的「圖像( 'ilmelogo.png') ; echo $ this-> Html-> link($ link,array('controller'=>'pages','action'=>'feedback')); ?> –

回答

0

你可以試試這個,

echo $this->Html->link(
    $this->Html->image('ilmelogo.png'), 
    '/pages/feedback', 
    array('class' => 'button', 'target' => '_blank') 
); 

OR

<?php 
echo $this->Html->link(
    $this->Html->image("ilmelogo.png", array("alt" => "ilme Logo")), 
    array(
    'controller' => 'pages', 
    'action' => 'feedback' 
    ) 
); 
+0

這就是我得到的[鏈接] http://development.luminogurus.com/phperror.png – rahulbehl

+0

得到了解決方案thanx'code' echo $ this-> Html-> image(「recipes/6.jpg」, array( 「alt」=>「Brownies」, 'url'=> array('controller'=>'recipes','action'=>'view',6) )); – rahulbehl