0
votes

I've code that will link to logout page and the logout text have css with font awesome.. below is the code..

<? php echo $this->Html->link(__('Logout', true), 
array('controller' => 'users', 'action' => 'Logout'),
array('class'=>'fa fa-sign-out fa-fw')); ?> 

But when it display, the menu not display nicely like below.

Screenshot menu with css

The problem is at the first logout link. 1) The highlighted only at the icon logout, not to the all text. 2) The font also not same with the other text.

The last Logout link i code using normal html code like below.

<a href="login.html"><i class="fa fa-sign-out fa-fw"></i> Logout</a> 

The question, where is the problem in my cakephp coding?

Thanks in advance.

1

1 Answers

0
votes

See this.

echo $this->Html->link(
   '<i class="fa fa-sign-out fa-fw"></i> Logout',
    array(
        'controller'=>'users',
        'action'=>'Logout'
    ),
    array(
        'escape'=>false  //NOTICE THIS LINE ***************
    )
);

Output will be

<a href="login.html"><i class="fa fa-sign-out fa-fw"></i> Logout</a>