Apr 7, 2020
9
Level 1
how to make variable for "@yield"
Blade on how to make PHP variable for "@yield". ?
//Standard Yield
@yield('content')
//I want to do... (call pages by name.)
@yield($variable)
Level 3
whatever inside the yield function is a variable itself @yield('content') for example "content" is variable declared in the blade file you are extending from!
so you may use
@yield('variable')
and in the blade you extend
@section('variable', 'what ever you need to display')
you might need to change the value so you may use something like this
$variable = "content";
@section('variable', $variable)
1 like
Please or to participate in this conversation.