In Laravel
, we usually use Blade
to be able to write a view
.
Example:
@unless($variable)
<p>Nenhum dado encontrado</p>
@else
@foreach($variable as $v)
<p>{{ $v }} </p>
@endforeach
@endunless
This code is "compiled" for:
<?php if (! ($variable)): ?>
<p>Nenhum dado encontrado ?>
<?php else: ?>
<?php foreach($variable as $v): ?>
<p>{{ $v }} </p>
<?php endforeach ?>
<?php endif?>
Any doubts that have arisen are:
-
Does
Laravel
have to convertBlade
to a valid PHP code, using regular expressions and the like, can not this result in performance loss? -
Should I be more concerned with the ease of writing the code than with the performance in these cases?