From 16a21af657cd535b2f899e42de754d5b3b6fc6c8 Mon Sep 17 00:00:00 2001 From: ADmad Date: Mon, 16 Sep 2024 18:47:24 +0530 Subject: [PATCH] Add example for generating meta tag with CSRF token Also fix formatting --- en/views/helpers/html.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/en/views/helpers/html.rst b/en/views/helpers/html.rst index a432d69a54..db2b022c7e 100644 --- a/en/views/helpers/html.rst +++ b/en/views/helpers/html.rst @@ -149,12 +149,11 @@ csrfToken The current CSRF token .. code-block:: php - Html->meta( + echo $this->Html->meta( 'favicon.ico', '/favicon.ico', ['type' => 'icon'] ); - ?> // Output (line breaks added) // Note: The helper code makes two meta tags to ensure the // icon is downloaded by both newer and older browsers @@ -170,12 +169,11 @@ csrfToken The current CSRF token rel="shortcut icon" /> - Html->meta( + echo $this->Html->meta( 'Comments', '/comments/index.rss', ['type' => 'rss'] ); - ?> // Output (line breaks added) Html->meta( + echo $this->Html->meta( 'keywords', 'enter any meta keyword here' ); - ?> // Output - Html->meta( + echo $this->Html->meta( 'description', 'enter any meta description here' ); - ?> // Output + echo $this->Html->meta('csrfToken'); + // The CsrfProtection middleware must be loaded for your application + + In addition to making predefined meta tags, you can create link elements:: Html->meta([