Laravel 5: Display HTML with Blade

后端 未结 20 2415
栀梦
栀梦 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:44

    On controller.

    $your_variable = '';
    $your_variable .= '

    Hello world

    '; return view('viewname')->with('your_variable', $your_variable)

    If you do not want your data to be escaped, you may use the following syntax:

    {!! $your_variable !!}
    

    Output

    Hello world
    

提交回复
热议问题