我有一个包含HTML标记的正文的json响应:
{
"total": 15,
"per_page": 15,
"current_page": 1,
"last_page": 1,
"next_page_url": null,
"prev_page_url": null,
"from": 1,
"to": 15,
"data": [
{
"id": 48,
"title": "Lamb Ribs with mashed potatoes",
"body": "<p>Lamb Ribs with Mashed Potatoes:<br />230 grams of lamb ribs<br />Marinade:( Teaspoon pomegranate molasses, 1 tablespoon lemon juice, 1 teaspoon tomato paste, 1 teaspoon olive oil, salt, black pepper, oregano)<br />Marinate the ribs for at least 2 hours. Heat a non stick grilling skillet and grill the ribs from both sides untill done.<br /><br />Mashed Potatoes:<br />130 grams of peeled potatoes. Boil until cooked and let to cool.<br />Add a tablespoon of milk, salt, garlic powder and black pepper and mash together.<br />Serve immediately.<br /><br />545 calories<br />24.7 g fat<br />29.8 g carb<br />3.1 g fiber<br />48.3 g protein<br />.</p>",
"excerpt": "",
"format": "standard",
"type": "recipe",
注意:上面的json没有填满,因为它的响应文件很长。
我已解码上面的json:
$post = json_decode($response);
在视图文件中:
{{$post->body}}
我该如何解决这个问题?
答案 0 :(得分:0)
使用: -
解决{!! $text !!}