0

I'm using a HTML editor for fields, and having problem on printing the content on edit form using Model Binding and resource controller. Since the editor accepts HTML tags, they not escaped (htmlentities way), and inserted raw. While this might not be a problem, I need to find a way to print that text back into HTML editor with all HTML parsed, due to needed editing of the text.

This is the field that has a HTML editor attached through JS (for insert and edit):

{{ Form::textarea('text', null, array('class' => 'form-control')) }}

Out of model binding way of creating CRUD, {{ html_entity_decode($text) }} will do the job when outputting the text back to the editor.

Question: Is there a way to add htmlentities() to model-bind-form? I need to print back the text containing html inside HTML editor that will parse it correctly.

P.S. using Laravel's helper e() doesn't seem to solve the problem.

Thanks in advance

1 Answer 1

1

Have you tried passing the decoded text into the form:textarea like this:

{{ Form::textarea('text', html_entity_decode($model->text), array('class' => 'form-control')) }}
Sign up to request clarification or add additional context in comments.

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.