2

I have a VUEX store and a blog post that I need to output.

I use CKEditor for the input but I can't output the raw HTML with the @{{ }} in the front-end.

I have already tried to use @{{!! !!}} but apparently these doesn't work together.

This is the line that I output: <div>@{{ $store.state.item.conteudo }}</div>

And this is the actual output of the code:

<p><strong>Teste Laravel</strong></p>

1
  • what is the front end you are using? Commented Oct 21, 2019 at 4:53

2 Answers 2

2

You're using double bracket so, You should try {!! !!} instead of {{!! !!}}.

So now your variable looks like.

{!! $text !!}

Check more info. displaying data

Sign up to request clarification or add additional context in comments.

2 Comments

Tried and it didn't show. I'm getting the data in JavaScript from VUEX Store.I send data from the I want to output an html code but I can't use the.
Tried and it didn't show. Thanks @Dilip-hirapara I send data from a view button inside a table to a modal. And the modal shows the HTML input without a page refresh. I want to output an html code from JavaScript but I can't use the output PHP code.
0

you can also do like this by using getter in your model

Hope it help!

public function getConteudoAttribute($value) {
    return html_entity_decode($value);
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.