Reputation: 466
I'd like to add a icon <i>
tag to a Cakephp link.
Here is my code :
<?= $this->Html->link($this->Html->tag('i', '', array('class' => 'fa fa-shopping-cart')).'Cart', array('controller' => 'shop', 'action' => 'cart')) ?>
This line generates :
<a href="/cakephp-shopping-cart/shop/cart"><i class="fa fa-shopping-cart"></i>Cart</a>
Why <
is replaced by its hexa value? My charset is UTF-8.
Thanks!
Upvotes: 1
Views: 4809
Reputation: 21
Html->link($this->Html->tag('i', '',['class' => 'fa fa-shopping-cart']).'Cart',['controller' => 'shop', 'action' => 'cart'], ['escape' => false]); ?>
Upvotes: 0
Reputation: 3327
Add option 'escape'
set to false
:
<?= $this->Html->link($this->Html->tag('i', '', array('class' => 'fa fa-shopping-cart')).'Cart', array('controller' => 'shop', 'action' => 'cart'), array('escape' => false)) ?>
Documentation page about HtmlHelper
.
Upvotes: 9