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

I made a little progress with Blade::compileString() but it doesn't quite work.... anyone have any thoughts?

Example content

$content= '<h1>Contact Me</h1> @include('forms.contact')';

Display in blade

{{$content}}

The output is:

Contact Me
@include('forms.contact')

BUT If I do this in blade

{{Blade::compileString($content)}}

The output is:

Contact Me
make('forms.contact', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>

I am getting closer.. Am I going about this the wrong way? Should I write my own parser? Am I missing something obvious?

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

IanSirkit iansirkit Joined 24 Feb 2014

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.