Html markup in cakephp $ html-> link, e.g. $ Html-> link ('<SPAN> Hey </SPAN>')?
I have this code block 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 formatting, I see this literally:
<h1><a href="/rrweb/www/hub/pages/home"> Hello <span>Stack Overflow</span></a></h1> Any idea?
Thanks!
+4
2 answers
You need to disable the conversion of HTML objects :
echo $this->Html->link( 'Hello <span>Stack Overflow</span>', array('controller'=>'pages', 'action'=>'home'), array('escape' => FALSE) ); +23