Laravel @verbatim Directive
The {{}} print syntax we use in Blade is also used in most popular Javascript frameworks. Let's take Vue as an example.
In Blade, we need to use it as @{{ }} so that it doesn't interpret this syntax. Although it is not a problem to put the @ sign in sporadic spellings, it can be tedious to put the @ sign in front of all of them when we want to display many different data in vue or similar frameworks.
<div id="app">
Name @{{ name}}
Surname @{{ surname }}
Age @{{ age}}
<!-- And imagine there are a few more -->
</div>
To make this easier to write, Laravel offers us the @verbatim directive. When we write these codes in this directive, we no longer need to use the @ sign because it does not interpret the {{}} code in this directive as a blade syntax.
<div id="app">
@verbatim
Name {{ name }}
Surname {{ surname }}
Age {{ age }}
<!-- And imagine there are a few more -->
@endverbatim
</div>
Is it used? It is debatable, it would be good for you to know that there is such a directive if it bothers you one day.
Comments
Popular Articles
Popular Tags
- #directive
- #Function
- #Json
- #Class
- #SASS
- #Form
- #Redirect
- #API
- #Special Characters
- #Special
- #Random
- #Generating
- #
- #Text
- #Ajax
- #URL
- #Encrypting
- #React
- #Show
- #timeAgo
- #PSR-4
- #Hide
- #DDOS Protection
- #DDOS
- #cURL
- #Logic For Displaying Posts
- #Error
- #Key
- #General Error
- #1364 Field
- #Abbreviation
- #Blade
- #Version
- #QR
- #QR Code Generating
- #Array
- #Arrays with Key Values to String Statement
- #Short Tag
- #Activate
- #Real Time
- #Socket.io
- #301
- #Custom Directives
- #Iframe Detection
- #Date
- #Characters
- #Insert
- #Autoloader
- #Composer
- #Reading
There are no comments, make the firs comment