Written by
php-style
on
on
[Laravel] layout
[Laravel] layout
routes/web.php에 작성
//layout Route::get('/aa', function () { //uri가 /aa 일 때, $Languages = [ 'PHP', 'Java', 'C', 'Python' ]; return view('aa',[ //views/aa를 보여라 'Languages' => $Languages ]); }); Route::get('/bb', function () { //uri가 /bb 일 때, $alert = [ 'Hello', 'alert("Hello")' ]; return view('bb',[ //views/bb 보여라 'alert' => $alert ]); }); Route::get('/cc',[App\Http\Controllers\TestController::class,'index']); //uri가 /cc 일 때, app/Http/Controllers/TestController의 'index' 클래스를 실행해라
views/menu.blade.php에 작성
@yield('title', 'Laravel') {{--@section('title')에 주어진게 없다면 title은'laravel'로 한다--}} hello aa bb cc @yield('content') {{--@section('content')--}}
from http://soda-dev.tistory.com/50 by ccl(A) rewrite - 2021-11-17 15:01:13