cakephp,如何 link 有两个跨度

cakephp, how to link with two span

如何将两个 span 标签添加到 link?

<?php echo $this->Html->tag('span’, 
    $this->Html->link($v['name']['lastname'], 
    $v['link’]
    ); 
?>

//Output
<a class=« test" href="./#">
   <span>name</span>
   <span>lastname</span>
</a>

我不确定是一个好的开始,谢谢你的帮助

我认为应该这样做:

<?php echo $this->Html->link('<span>name</span><span>lastname</span>', '#', array('escape' => false)); ?>

只需将两个 span 标签与 link() 方法的第一个参数中的 HtmlHelper 连接起来。

echo $this->Html->link(
    $this->Html->tag('span', $v['name']) .
    $this->Html->tag('span', $v['lastname']),
    $v['link'],
    array('escape' => false)
);