4
In the Laravel
, we usually use the Blade
in order 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?>
Some doubts that have arisen are:
The fact that the
Laravel
have to convert theBlade
for a valid PHP code, using regular expressions and the like, this must not result in a loss of performance?I should be more concerned with the ease of writing the code than with the performance in such cases?
+1 Simple, beautiful and direct
– Wallace Maxters
Coisa Linda!!!!
– Kenny Rafael