Laravel Blade: @endsection vs @stop

后端 未结 3 501
天涯浪人
天涯浪人 2021-01-01 09:29

In Laravel Blade, we can basically do this:

@section(\'mysection\')

@endsection


@section(\'mysection\')

@stop

What is the difference be

3条回答
  •  春和景丽
    2021-01-01 09:41

    Both @endsection and @stop works.

    In Laravel 4 it seems that only @stop is supported 1. But from Laravel 5 onwards @stop is not even mention in the documentation 2.

    So I would suggest to use @endsection.

    See:

    • Laravel 4 Blade Documentation
    • Laravel 5.7 Blade Documentation (current stable)

提交回复
热议问题