Darpan Rangari
Darpan Rangari

Reputation: 1570

How can we read the content of html file which is stored in views folder in laravel?

I am trying to load the html file stored in views folder in laravel. I just want to get the path of that html so that I can read the content.

Is there any way to do this?

for a workaround am storing that html file in storage folder and reading the html content. But as I said this is just a workaround for me.I need to store that in views.

Upvotes: 2

Views: 2160

Answers (1)

Moppo
Moppo

Reputation: 19275

If you want to just get the html content of a view, you can simply do:

$html = View::make('your_view');

While, if you want to get the content of a json file (as you've asked in the comments), you should put it in the storage folder and get its content with:

$content = Storage::get('file.json');

Upvotes: 2

Related Questions