Html markup in cakephp's $html->link, eg. $html->link('Hey')?

前端 未结 2 1979
轮回少年
轮回少年 2021-01-06 07:42

I have this block of code in a cakephp .ctp file:

Html->link(\'Hello Stack Overflow\',

相关标签:
2条回答
  • 2021-01-06 08:16

    You need to disable HTML entity conversion:

    echo $this->Html->link(
        'Hello <span>Stack Overflow</span>',
        array('controller'=>'pages', 'action'=>'home'),
        array('escape' => FALSE)
    );
    
    0 讨论(0)
  • 2021-01-06 08:28

    or

    echo $this->Html->link('Hello', array('controller'=>'pages', 'action'=>'home')).' '.$this->Html->tag('span', $this->Html->link('Stack Overflow', array('controller'=>'pages', 'action'=>'home')), array()); 
    
    0 讨论(0)
提交回复
热议问题