Home » , , , , » Add span tag( or any html tag) to link in cakephp

Add span tag( or any html tag) to link in cakephp

Written By Unknown on Selasa, 08 Oktober 2013 | 02.08

To add <span> tag to cakephp link add span to label

"<span>Label name</span>"

and add

"array('escape' => false)"

to link as shown in below example.

Example:
<?php echo $this->Html->link(
    '<span>My Label</span>',
    array('action' => 'add'),
    array('escape' => false)
// This line will parse rather then output HTML
); ?>
One thing to note here 'escape' => false' must be added to 3rd parameter of link.
You can see the structure of cakephp link for more information at

http://book.cakephp.org/2.0/en/core-libraries/helpers/html.html
Share this article :

Posting Komentar

 
Support : Creating Website | Johny Template | Mas Template
Copyright © 2011. Kumpulan Kata Broadcast Blackberry - All Rights Reserved
Template Created by Creating Website Published by Mas Template
Proudly powered by Blogger