In which Class are these 'blade functions' startSection() and stopSection()?

我怕爱的太早我们不能终老 提交于 2019-12-24 21:20:12

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!