Laravel 5: Display HTML with Blade

后端 未结 20 2473
栀梦
栀梦 2020-11-22 16:21

I have a string returned to one of my views, like this:

$text = \'

Lorem ipsum dolor

20条回答
  •  鱼传尺愫
    2020-11-22 16:33

    You can do that using three ways first use if condition like below

    {!! $text !!}
    

    The is Second way

    
    @if( $order->status == '0' )
        
    @else
        
    @endif
    
    

    The third and proper way for use ternary operator on blade

    
          {!! $order->status=='0' ? 
              ' : 
              ' !!}
    
    

    I hope the third way is perfect for used ternary operator on blade.

提交回复
热议问题