iyourplus
iyourplus

Reputation: 113

How to Render a String by Laravel Template Engine

How can I render an string which contains blade syntax?

View::render('{{$var}}')->with('var', $var); // Like this for Example

Upvotes: 7

Views: 1800

Answers (1)

Sh1d0w
Sh1d0w

Reputation: 9520

I believe this is what you are looking for

https://github.com/TerrePorter/StringBladeCompiler

This package allows you to compile blade strings.

Upvotes: 1

Related Questions