我刚刚开始学习 Laravel 框架,以便开始一个新项目。但是,我遇到了一个问题,@yield 函数没有在屏幕上显示该部分。但是,如果我在 @yield 前面放一个字母,则会创建一个文本“x@yield('section')”,这意味着 @yield('section') 不会执行任何操作。请解释为什么会发生这种情况。
目标 outes\web.php
<?php
use Illuminate\Support\Facades\Route;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "web" middleware group. Make something great!
|
*/
Route::get('/', function () {
return view('welcome');
});
目标 资源观