How can we read the content of html file which is stored in views folder in laravel?
Ad
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.
Ad
Answer
Ad
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');
Ad
source: stackoverflow.com
Related Questions
Ad
- → "failed to open stream" error when executing "migrate:make"
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS create a multi select Form field
- → October CMS - Conditionally Load a Different Page
- → How to disable assets combining on development in OctoberCMS
- → October CMS - Radio Button Ajax Click Twice in a Row Causes Content to disappear
- → OctoberCms component: How to display all ID(items) instead of sorting only one ID?
- → In OctoberCMS how do you find the hint path?
- → How to register middlewares in OctoberCMS plugin?
Ad