问题
When you open the cached view inside storage/framework/views/, there are rendered blade views and I can't find these functions:
$__env->startSection('content');
and
$__env->stopSection();
It's probably made with call_user_func() so you can't get to it just by clicking Ctrl+Click, this needs to be answered by someone who really knows the guts of Laravel :)
回答1:
You can find these methods in the traits used on the Illuminate\View\Factory class.
https://github.com/laravel/framework/blob/5.8/src/Illuminate/View/Factory.php#L17-L23
This specific method is actually on the Illuminate\Views\Concerns\ManagesLayouts trait.
https://github.com/laravel/framework/blob/5.8/src/Illuminate/View/Concerns/ManagesLayouts.php
Also, in the constructor of that class you will see that $__env is shared with the view.
https://github.com/laravel/framework/blob/5.8/src/Illuminate/View/Factory.php#L99
来源:https://stackoverflow.com/questions/55302990/in-which-class-are-these-blade-functions-startsection-and-stopsection