0

我正在尝试使用 CakePHP 2.1 中的 HTML Helper 复制以下代码。不确定如何将 Span 标签包含到标签中。

<div class="backTo">
    <a href="#" title="">
      <img src="images/icons/topnav/mainWebsite.png" alt="" />
      <span>Main website</span>
    </a>
</div>

我试过的

<?php echo $this->Html->image("icons/topnav/mainWebsite.png", array("alt" => "Back", 'url' => array('controller' => 'pages', 'action' => 'display', 'home')); ?>
4

1 回答 1

2
echo $this->Html->link(
    $this->Html->image('...', array(...)) . '<span>Main website</span>',
    array('controller' => ...),
    array('escape' => false)
);
于 2012-04-09T05:43:06.323 回答