Support the ongoing development of Laravel.io →
Views Blade

I don't know if I choosed a good title for this question or not.

I want to implement a Template Engine to convert:

<ul>
[LOOP information]
    <li>{{name}}</li>
[ENDLOOP]
</ul>

to:

<ul>
@foreach( $information as $element )
    <li>{{$element->name}}</li>
@endforeach
</ul>

I've done converting. But I can't execute it runtime. eval("?>" . $html ) does not work.

Question is: How Laravel Blade compiles statements so I do the same ?

Also I tried to instantiate a new object from BladeCompiler in Illuminate\Filesystem\BladeCompiler but it's not working.

// Class 'BladeCompiler' not found
Last updated 3 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

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.

© 2025 Laravel.io - All rights reserved.