Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Comment in .blade.php template

I am new in blade template. How i comment here?

PHP i can comment like this

<?php // echo $games;?>

Laravel Blade

{{ $game }}

like image 895
Faridul Khan Avatar asked Nov 15 '17 07:11

Faridul Khan


1 Answers

In blade syntax, a comment starts with {{-- and ends with --}}

{{-- this is a comment --}}

But to comment out multiple lines, use standard PHP block comments instead, like:

<?php /* 
@if ($condition)
    {{ HTML::form("foo") }};
@endif
*/ ?> 

And never nest Blade and/or PHP code inside of Blade comments.

See also stackoverflow.com/Why Blade comment causes page to crash?

like image 64
twoTimesAgnew Avatar answered Oct 02 '22 19:10

twoTimesAgnew