在链接标记内插入图像

时间:2014-01-08 11:21:18

标签: php cakephp-2.3 cakephp-2.4

以下代码无效

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

但是这段代码正在运作。帮帮我

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

1 个答案:

答案 0 :(得分: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'
    )
);