Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
like image 342
iyourplus Avatar asked Jun 23 '15 03:06

iyourplus


1 Answers

I believe this is what you are looking for

https://github.com/TerrePorter/StringBladeCompiler

This package allows you to compile blade strings.

like image 58
Sh1d0w Avatar answered Oct 21 '22 06:10

Sh1d0w