Categories
Laravel

Render Laravel view in Controller

You may want to grab the output of a Laravel view; for example to store in cache. You can do so with the render method;

[code]
$result = View::make( ‘index’, $data );
Cache::put(‘mykey’, $result->render(), 10);
[/code]

 

Leave a Reply

Your email address will not be published. Required fields are marked *