Search code examples
cakephpcakephp-1.3html-helper

CakePHP HTML link


I am trying to use CakePHP HTML Linker for the following code

<li class="iAdd"><a href="add"><span>Add Cuisine</span></a></li>

Since the span tag needs to be inside the a tag. am not able to get the output as need. Any suggestions on how to get it done ?


Solution

  • Disable the escape option in your link code, like so:

    <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>