View Helpers
csrfMetaTags()
Signature
Section titled “Signature”csrfMetaTags() — returns string
Available in: controller
Category: Miscellaneous Functions
Description
Section titled “Description”The csrfMetaTags() helper generates meta tags containing your application’s CSRF authenticity token. This is useful for JavaScript/AJAX requests that need to POST data securely, ensuring that the request comes from a trusted source.
Examples
Section titled “Examples”<head>
<title>My Application</title>
#csrfMetaTags()#
</head>
// This will output something like:
// <meta name="csrf-token" content="YOUR_AUTH_TOKEN_HERE">
// <meta name="csrf-param" content="authenticityToken">