Support the ongoing development of Laravel.io →
posted 8 years ago
Blade
Last updated 2 years ago.
0

First your question is a little vague. I'm assuming your expected results in d.blade.php is not correct,

  1. You misspelled blade in c.blade.php
  2. 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')

0

dynamitesushi said:

First your question is a little vague. I'm assuming your expected results in d.blade.php is not correct,

  1. You misspelled blade in c.blade.php
  2. 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.

0

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.)

0

Sign in to participate in this thread!

Eventy

Your banner here too?

zerochs zerochs Joined 16 Dec 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.