0

I want to put Bootstrap Icon inside of my blade..But the problem is i couldn't get the actual output..Means here is the sample code:

@if (($row->is_management) === 1)
       <td> <span class="glyphicon glyphicon-ok"></span> </td>
 @else
       <td><span class="glyphicon glyphicon-remove"></span></td>
 @endif

Means if status is 1 then green checked will come and in another condition red cross.

Can anyone suggest me what the actual mistake here?

User57
  • 2,453
  • 14
  • 36
  • 72
  • more look like the icon font style css is not loaded on to the site. BTW may be this will help you:-http://stackoverflow.com/questions/29253979/laravel-5-display-html-with-blade – Alive to die - Anant Jan 12 '17 at 07:22
  • nothing just blank – User57 Jan 12 '17 at 07:26
  • I don't see any error in controller as ..if i want to show `hello` in if condition and 'nothing' in else condition i could do that but when I go for the icon,it didn't come. – User57 Jan 12 '17 at 07:31

2 Answers2

2

It will work on bootstrap css with glyphicons fonts. Please make sure that u have bootstrap css called and have glyphicons fonts

ToJ
  • 155
  • 7
0
 @if (($row->is_management) == 1)
       <td> <span class="glyphicon glyphicon-ok"></span> </td>
 @else
       <td><span class="glyphicon glyphicon-remove"></span></td>
 @endif

Try this, use == instead of ===

Updated Code:

 @if (($row->is_management) == 1)
      {{ <td> <span class="glyphicon glyphicon-ok"></span> </td> }}
 @else
      {{ <td><span class="glyphicon glyphicon-remove"></span></td> }}
 @endif
Arun Code
  • 1,548
  • 1
  • 13
  • 18