2014-01-08 300 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