• If the variable contains HTML markup information, the HTML markup is converted into symbolic entities in the output, but the browser does not parse the content, you need to set two exclamation marks: {!! The $variable!!!!! }.

  • Such as:

    Route: : get (' the req ', function () {/ / Json parameter $data = [' id '= > 1,' name '= >' DZM, 'home' = > '< a href = "https://www.baidu.com" > baidu < / a >'; / / pass the return view (' index ') - > with ([' data '= > $data]); });Copy the code

    There is a home field in the data uploaded to the view template page, which is the A tag, and all you need to display is a normal A tag, not an output string.

    This is where {!! The $variable!!!!! } syntax

    <! DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta  name="viewport" content="width=device-width, > <title>Document</title> </head> <body> <div>DZM view file test </div> <div>ID: {{ $data['id'] }}</div> <div>Name: {{ $data['name'] }}</div> <div>Home: {{ $data['home'] }}</div> <div>Home: {!! $data['home'] !! }</div> </body> </html>Copy the code