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


i have block of code in cakephp .ctp file:

<h1>     <?php echo $this->html->link('hello <span>stack overflow</span>',         array('controller'=>'pages', 'action'=>'home'));  ?> </h1> 

but instead of html being formatted, i'm seeing literally:

<h1><a href="/rrweb/www/hub/pages/home"> hello &lt;span&gt;stack overflow&lt;/span&gt;</a></h1>  

any idea's?

thanks!

you need disable html entity conversion:

echo $this->html->link(     'hello <span>stack overflow</span>',     array('controller'=>'pages', 'action'=>'home'),     array('escape' => false) ); 

Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -