Output Laravel 4 view as string

The answer seems really obvious once you know it.

[php]
->render();
[/php]

Used like this:

[php]
$nav_primary_data = json_decode(file_get_contents('navs/primary.json', true);
$view_string = View::make('layouts.master.navs.primary')->with('nav_primary_data', $data)->render();
[/php]

I'm not sure why it's not mentioned in the Views & Responses documentation.

But the method can be seen in the  API docs: \Illuminate\View\View

Output Laravel view as string

The answer seems really obvious once you know it.

[php]
->render();
[/php]

Used like this:

[php]
$nav_primary_data = json_decode(file_get_contents('navs/primary.json', true);
View::make('layouts.master.navs.primary')->with('nav_primary_data', $data)->render();
[/php]

I'm not sure why it's not mentioned in the Views & Responses documentation.

But the method can be seen in the  API docs: \Illuminate\View\View

Output Laravel view as string

The answer seems really obvious once you know it.

[php]
->render();
[/php]

Used like this:

[php]
$nav_primary_data = json_decode(file_get_contents('navs/primary.json', true);
$view_string = View::make('layouts.master.navs.primary')->with('nav_primary_data', $data)->render();
[/php]

I'm not sure why it's not mentioned in the Views & Responses documentation.

But the method can be seen in the  API docs: \Illuminate\View\View

Output Laravel 4 view as string

The answer seems really obvious once you know it.

[php]
->render();
[/php]

Used like this:

[php]
$nav_primary_data = json_decode(file_get_contents('navs/primary.json', true);
$view_string = View::make('layouts.master.navs.primary')->with('nav_primary_data', $data)->render();
[/php]

I'm not sure why it's not mentioned in the Views & Responses documentation.

But the method can be seen in the  API docs: \Illuminate\View\View