7

How can I render an string which contains blade syntax?

View::render('{{$var}}')->with('var', $var); // Like this for Example
2
  • 1
    Why would you need this? Commented Jun 23, 2015 at 3:52
  • 1
    I need a RESTful API that can render posted string. Commented Jun 23, 2015 at 10:53

1 Answer 1

1

I believe this is what you are looking for

https://github.com/TerrePorter/StringBladeCompiler

This package allows you to compile blade strings.

Sign up to request clarification or add additional context in comments.

2 Comments

AFAIK no, thats why this package exists.
I always get "realpath() expects parameter 1 to be a valid path, object given" error though with render() method

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.