Get Off My Lawn Get Off My Lawn - 10 months ago 39
PHP Question

Laravel DataTable plugin is outputting code with htmlentities

I am using this DataTable plugin for Laravel, which is for using This jQuery DataTable plugin.

I Followed the instructions found here, so this is my controller:

class FeedbackController extends Controller {

public function UserFeedback(Request $request) {
$t = Datatable::make(new CollectionProvider(FeedbackModel::all()))

if ($t->shouldHandle()) {
return $t->handleRequest();

return view('', ['datatable' => $t->view()]);


And this is in my view:


But for some reason when I load the page it is outputting the html with htmlentities like this:

<table id="dataTable">
</table><script type="text/javascript">
jQuery(document).ready(function () {
// dynamic table
oTable = jQuery('#dataTable').DataTable({
"processing": true,
"serverSide": true,
"ajax": "/",
"columns": [
{ 'data': 'overall' },

Why is it doing this?


This will help you (taken from laravel docs)

Displaying Raw Text With Curly Braces

If you need to display a string that is wrapped in curly braces, you may escape the Blade behavior by prefixing your text with an @ symbol:

@{{ This will not be processed by Blade }}

If you don't want the data to be escaped, you may use the following syntax:

Hello, {!! $name !!}.

Use that on this...


Ignore the above, that is the wrong way around, do the below...


You can decode the html like this...


and output that...