diff --git a/en/the-basics/views.md b/en/the-basics/views.md index 803b109f8..277279a1e 100644 --- a/en/the-basics/views.md +++ b/en/the-basics/views.md @@ -112,7 +112,7 @@ This middleware can be applied to routes to ensure that requests are coming from ::: v-pre 1. Register the middleware (`github.com/goravel/framework/http/middleware::VerifyCsrfToken(exceptPaths)`) to global or a specific route. -2. Add `` to your form in the view file, or add `X-CSRF-TOKEN={{ .csrf_token }}` to your request header to include the CSRF token. +2. Add `{{ .csrf_field }}` (which renders ``) to your form in the view file, or add `X-CSRF-TOKEN={{ .csrf_token }}` to your request header to include the CSRF token. 3. The middleware will automatically verify the token on form submission. ::: diff --git a/zh_CN/the-basics/views.md b/zh_CN/the-basics/views.md index 3e748ed47..aded3010e 100644 --- a/zh_CN/the-basics/views.md +++ b/zh_CN/the-basics/views.md @@ -113,7 +113,7 @@ func Boot() contractsfoundation.Application { ::: v-pre 1. 将中间件(`github.com/goravel/framework/http/middleware::VerifyCsrfToken(exceptPaths)`)注册到全局或特定路由。 -2. 在视图文件中向表单添加 ``,或在请求头中添加 `X-CSRF-TOKEN={{ .csrf_token }}` 以包含 CSRF 令牌。 +2. 在视图文件中向表单添加 `{{ .csrf_field }}`(会渲染为 ``),或在请求头中添加 `X-CSRF-TOKEN={{ .csrf_token }}` 以包含 CSRF 令牌。 3. 中间件将在表单提交时自动验证令牌。 :::