# Laravel View の文字列取得
> Laravel の View 文字列を取得する方法
- Canonical: https://c-a-p-engineer.github.io/laravel-view-render/
- Published: 2021-03-10T09:00:00.000Z
- Modified: 2021-03-10T09:00:00.000Z
- Categories: PHP
- Tags: PHP, Laravel

Laravel で View の文字列を取得したい時の対応
※Laravel 6.2 で確認

## サンプルソース

``` php
<?php
$viewStr = View::make('home')->render();
```

指定のセクションを取得
``` php
<?php
$viewStr = View::make('home')->renderSections()['content'];
```
