Support the ongoing development of Laravel.io →
Database Eloquent Blade
Last updated 2 years ago.
0

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

0

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 '<'".

0

try <?php eval($page->code) ?>

0

Not working... Some tips?

0

Could be coming from the code you are evaling. And this sounds like a bad idea.

0

I've heard eval is evil

0

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

Last updated 8 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Gun22 gun22 Joined 1 Jan 2016

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.