Commit 8685b790 by hfpp2012 yinsigan

blade if else end

1 parent 97485d4c
...@@ -30,6 +30,8 @@ class PagesController extends Controller ...@@ -30,6 +30,8 @@ class PagesController extends Controller
public function blade() public function blade()
{ {
return view('blade.bladetest'); $gender = 'femffffale';
$text = 'Hello there!';
return view('blade.bladetest', compact('gender', 'text'));
} }
} }
...@@ -6,9 +6,28 @@ ...@@ -6,9 +6,28 @@
@section('body') @section('body')
<div class="jumbotron"> <div class="jumbotron">
<h1 class="display-3">Jumbotron heading</h1> <h1 class="display-3">
<p class="lead">Cras justo odio, dapibus ac facilisis in, egestas eget quam. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p> Your gender is
<p><a class="btn btn-lg btn-success" href="#" role="button">Sign up today</a></p> @if($gender == 'male')
male
@elseif($gender == 'female')
female
@else
unknown
@endif
</h1>
<p class="lead">
@unless(empty($text))
{{ $text }}
@endunless
@if(!empty($text))
{{ $text }}
@endif
</p>
<p>{{ isset($variableDoesNotExist) ? $variableDoesNotExist : 'The variable does not exist' }}</p>
<p>{{ $variableDoesNotExist or 'This really does not exist' }}</p>
</div> </div>
<div class="row marketing"> <div class="row marketing">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!