Har*_*M V 5 cakephp html-helper cakephp-1.3
我正在尝试使用CakePHP HTML Linker获取以下代码
<li class="iAdd"><a href="add"><span>Add Cuisine</span></a></li>
Run Code Online (Sandbox Code Playgroud)
由于span标记需要位于标记内.我无法根据需要获得输出.关于如何完成任何建议?
禁用链接代码中的转义选项,如下所示:
<li class="iAdd">
<?php echo $this->Html->link(
'<span>Add Cuisine</span>',
array('action' => 'add'),
array('escape' => false) // This line will parse rather then output HTML
); ?>
</li>
Run Code Online (Sandbox Code Playgroud)
你总是可以在链接中使用普通的html:
$this->Html->link('<span>'.h($text).'</span>', array('action'=>'add'), array('escape'=>false));
Run Code Online (Sandbox Code Playgroud)