Laravel Blade:@endsection 与 @stop

2022-01-08 00:00:00 php laravel-4 blade

在 Laravel Blade 中,我们基本上可以这样做:

In Laravel Blade, we can basically do this:

@section('mysection')

@endsection


@section('mysection')

@stop

@stop@endsection有什么区别?

推荐答案

@endsection 在 Laravel 3 中使用,在 Laravel 4 中已弃用

The @endsection was used in Laravel 3 and it was deprecated in Laravel 4

在 Laravel 4 中要结束一个部分你必须使用 @stop

In the Laravel 4 to end a section you have to use @stop

您可以在此处参考更新日志http://wiki.laravel.io/Changelog_%28Laravel_4%29#Blade_Templating

You can refer the Changelog here http://wiki.laravel.io/Changelog_%28Laravel_4%29#Blade_Templating

相关文章