what are you trying to do? maybe we can suggest something better?
you can certainly do that but with raw PHP or create a blade extension.. with raw php you might do:
eval($row->code)..
but be careful this is/can be dangerous if you dont know where the code is coming from
I'm using Laravel 4.2. It's a dynamic page system, and I want to add php functions to pages. I place "{{ eval($page->code) }}" to the blade, but it send error messages like this: "syntax error, unexpected '<'".
Could be coming from the code you are eval
ing. And this sounds like a bad idea.
With Laravel 4.*, you must use the following syntax to disable escaping in Blade views:
{{{ $output }}}
And the new syntax since Laravel 5+:
{!! $output !!}
You can find more information in the laravel documentation
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community