Edge templating, @section inside @component


#1

I’ve seen that when I tried to use a @component and a @section inside the component I get an error!

I would like to decouple things and probably re-use the sections defined in the layouts.master inside a component.

For instance, I have a @!section('extra_js') which is right at the bottom of the @layouts('master') and within the component, I would like to add JS dependencies that are only related to the component itself and to be loaded only when that component is in use.


#2

Another thing that i’ve noticed is that when you try to re-use a @section within a @section itself it doesn’t include the code where is supposed to be.

e.g.

- master.edge
@!section('content')
@!section('bottom')

- home.edge
@section('content')
    <h1>Welcome</h1>
    @section('bottom')
         <p>some other text</p>
    @endsection
@endsection

the code from the nested section is included within the @section('content') rather than @section('bottom')


#3

Yes first error is that sections cannot nested. It will be nice if you can share one error at a time with the actual code