9
After a brief discussion of why the HTML is not a programming language, characterize that not because it is not able to perform calculations, make decisions, change information contained in some type of memory, etc.
Blade is the language used by Laravel to build views. It contains the instructions started with a @
, for example the @if
, @section
, @for
, etc. It uses Laravel and PHP expressions to work.
Blade also has variables, but you don’t declare them directly on it. It gets the variables from the controller, and you can access with {{ }}
.
This is an example of a Blade:
<div class="row">
<div class="col">
@if (isset($mensagem))
<div class="alert alert-danger">{{ $mensagem }}</div>
@else
<div class="alert alert-primary">Tudo funcional.</div>
@endif
</div>
</div>
The above Blade was able to understand whether the variable $mensagem
exists or not. Made a decision.
This makes the Laravel Blade a programming language?
One of the needs of a programming language is "change information contained in some type of memory;", if he only accesses the memory but does not change it, I believe it is not (narrowly). I am not an expert so I will leave the answers to those who understand
– Costamilam
@Costamilam then, the fact that she reads, but does not create, confuses me a little. Although, with
<?php $variavel = 123 ?>
you declare, and soon you can read in Blade. But there you are already using PHP directly, but then Blade is also indirect PHP. I do not know.– CypherPotato
You can place CSS inline in HTML tags or inside
<style>
, but it’s still separate languages. And like Woss said,, "PHP is a programming language or a superset of C?" just like Blade is PHP. It depends on your definition of what a programming language is– Costamilam