have you tried this on your view?
@extends('../layout.header')
extjac said:
have you tried this on your view?
@extends('../layout.header')
Hey #extjac, thanks for your suggestion. Have tried it, does only work within a Blade view file. I then have to rename the view to index.blade.php
.
But I would like not to use the Blade syntax. I need and want to use only native PHP within the views. and require '...';
doesn't seem to work in other sub- or upper view folders. Only in the same folder.
I even left the header.php in a folder above /home directly under /views.
views
header.php
footer.php
/home
index.php
Then in index.php
:
require '../header.php';
It doesn't work, gives the same error. Does normal file traversing work within the app folder structure?
Found a solution in calling the app_path()
require app_path().'/views/layout/header.php';
Now I just need to add a custom helper function for view_path()
, so i can call it like:
require view_path().'/layout/header.php';
But that's another story.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community