user2617403
user2617403

Reputation: 397

Removing StripSlash in Blade Ouput

I would like to remove the stripslash "\" character from my database search result.

Instead of using {{stripslashes($output->var)}}, which add a PHP function on every output in blade, can I do it GLOBALLY in the BladeCompiler file?

I want to apply this change in every output {{ }} in my Laravel site, any suggestion? I tried to modify the Bladecompiler file compileRegularEchos function, seems not working, please advice

Upvotes: 0

Views: 1091

Answers (1)

Rias
Rias

Reputation: 186

I'm assuming you're using Laravel 5 because Blade templating defaults to escaping now. If you want to echo something without escaping you can use this syntax:

{!! $output->var !!}

For more info you can check the Blade docs

Upvotes: 2

Related Questions