本文介绍了这些“刀片函数"的startSection()和stopSection()在哪个类中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当您打开storage/framework/views/内的缓存视图时,将显示渲染的刀片视图,而我找不到以下功能:

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');

$__env->stopSection();

它可能是用call_user_func()制成的,因此您不能仅通过单击Ctrl + Click来实现它,这需要真正了解Laravel胆量的人来回答:)

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 :)

推荐答案

您可以在Illuminate\View\Factory类所使用的特征中找到这些方法. https://github.com/laravel/framework/blob/5.8/src/Illuminate/View/Factory.php#L17-L23

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

此特定方法实际上是Illuminate\Views\Concerns\ManagesLayouts特征. https://github.com/laravel/framework/blob/5.8/src/Illuminate/View/Concerns/ManagesLayouts.php

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

此外,在该类的构造函数中,您将看到$__env与视图共享. https://github.com/laravel/framework/blob/5.8/src/Illuminate/View/Factory.php#L99

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

这篇关于这些“刀片函数"的startSection()和stopSection()在哪个类中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-12 10:01