Comment line in Laravel 5.1

1

How can I comment a line in a Laravel template that contains @include , @section , @endsection and even img src"{{ asset('libs/magnific-popup/magnific-popup.js') }}"

I tried with

  • <!-- -->
  • //
  • /*

but I still do not try to convince myself that it is well done.

    
asked by zerokira 10.11.2017 в 14:42
source

2 answers

1

You can do it like this:

{{-- Esto es un comentario --}}
    
answered by 10.11.2017 / 14:43
source
0

The comment for the laravel blade templates is:

{{-- bla bla bla --}}

These keys comment not only the html elements of your template but also structures such as:

@section
@yield
@if()....@endif
...

While the html comment will only comment on the html tags within them (but not the php code), the blade tags {{- -}} will comment on both.

That is:

In both cases, the PHP content will be processed:

<!-- <span><?php echo $saludo ?></span> --> 
<!-- <span>@content('bloque')</span> --> 

In contrast, in these cases, not:

{{-- <span><?php echo $saludo ?></span> --}} 
{{-- <span>@content('bloque')</span> --}} 
    
answered by 13.12.2018 в 20:33