Laravel frameworkThere are many very useful auxiliary functions. In the following article, I will introduce you to several commonly used auxiliary functions.
{{ csrf_token() }}
In this way, you can directly obtain the csrf_token maintained by Laravel itself. For example, it is usually used like this:
Or you can also directly get the hidden form of csrf token like this:
{!! csrf_field() !!}
This will directly output content similar to the following in html:
When using resource routing, there are some methods that the browser cannot support natively, such as DELETE, PATCH PUT, etc. At this time, you can use the code To generate method forms and simulate these requests:
{{ method_field('DELETE') }}
Generated HTML:
The above is the entire content of this article. For more laravel content, please pay attention to thelaravel framework introductory tutorial..
Recommended related articles:
The process of using Echo in the Laravel framework
The implementation of laravel framework in data statistical drawing
Related course recommendations:
The latest five Laravel video tutorial recommendations in 2017
The above is the detailed content of Introduction to commonly used auxiliary functions in the Laravel framework. For more information, please follow other related articles on the PHP Chinese website!