프로그래밍/Laravel5

Laravel - Blade Template (조건문)

도꼬 2017. 8. 20. 17:38
반응형

route/web.php

Route::get('calc/{num}',function(){

    return view('calc')->with('num',$num);

});

 

resources/views/calc.blade.php

@if ($num > 5)

 <p>{{ $num }} is greater than 5. </p>

@elseif ($num == 5)

 <p>{{ $num }} is equal to 5 </p>

@else

 <p>{{ $num }} is less then 5 </p>

@endif

 

 

== if(!) ==

@unless (Auth::isSigned())

  <p> login faild </p>

@endunless

반응형

'프로그래밍 > Laravel5' 카테고리의 다른 글

Laravel - Layout상속  (0) 2017.08.20
Laravel - Blade Template (반복문)  (0) 2017.08.20
Laravel - Blade Template  (0) 2017.08.20
Laravel - Views  (0) 2017.08.20
Laravel - HTTP Response(Json변환)  (0) 2017.08.20