First your question is a little vague. I'm assuming your expected results in d.blade.php is not correct,
When you're including a file in your blade file, you shouldn't be including an entire page that contains extends. You want to focus including plain HTML/JS or PHP.
For example, you could be making a page that doesn't extend a.blade.php (which is your main template) but you want to include the same sidebar you used in your main template. You would then just migrate the plain sidebar HTML/PHP and include it in @section('sidebar')
dynamitesushi said:
First your question is a little vague. I'm assuming your expected results in d.blade.php is not correct,
- You misspelled blade in c.blade.php
- You're not extending your main template in d.blade.php which is fine.
When you're including a file in your blade file, you shouldn't be including an entire page that contains extends. You want to focus including plain HTML/JS or PHP.
For example, you could be making a page that doesn't extend a.blade.php (which is your main template) but you want to include the same sidebar you used in your main template. You would then just migrate the plain sidebar HTML/PHP and include it in @section('sidebar')
Thank for answering my question, and point to my mistake of spell.
I'm very confused about your conversation you shouldn't be including an entire page that contains extends
why not?
What can I do If I want to include two component in the main page,and the two component was extends from one same template.
I think this kind of demand must existed.
You're including a page that is extending the main template, so if you're including both b and c, you're extending the main template (a.blade.php) twice which is wrong. You need to restructure your site so every sub page (b,c,d) etc. extend a but have components that you include in (sidebar, footer, header etc.)
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community