Skip to content

Commit 4df08f2

Browse files
authored
Update TwigExtension.php
1 parent da89176 commit 4df08f2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Turbo/src/Twig/TwigExtension.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ public function turboStreamListen(Environment $env, $topic, ?string $transport =
6565
/**
6666
* Generates <meta> tags to configure both the refresh method and scroll behavior for page refreshes.
6767
*
68+
* Inspired by Turbo Rails
69+
* ({@see https://github.com/hotwired/turbo-rails/blob/main/app/helpers/turbo/drive_helper.rb}).
70+
*
6871
* @param string $method The refresh method. Must be either 'replace' or 'morph'.
6972
* @param string $scroll The scroll behavior. Must be either 'reset' or 'preserve'.
7073
*
@@ -78,6 +81,9 @@ public function turboRefreshesWith(string $method = self::REFRESH_METHOD_REPLACE
7881
/**
7982
* Generates a <meta> tag to configure the refresh method for page refreshes.
8083
*
84+
* Inspired by Turbo Rails
85+
* ({@see https://github.com/hotwired/turbo-rails/blob/main/app/helpers/turbo/drive_helper.rb}).
86+
*
8187
* @param string $method The refresh method. Must be either 'replace' or 'morph'.
8288
*
8389
* @return string The <meta> tag for the specified refresh method
@@ -96,6 +102,9 @@ public function turboRefreshMethod(string $method = self::REFRESH_METHOD_REPLACE
96102
/**
97103
* Generates a <meta> tag to configure the scroll behavior for page refreshes.
98104
*
105+
* Inspired by Turbo Rails
106+
* ({@see https://github.com/hotwired/turbo-rails/blob/main/app/helpers/turbo/drive_helper.rb}).
107+
*
99108
* @param string $scroll The scroll behavior. Must be either 'reset' or 'preserve'.
100109
*
101110
* @return string The <meta> tag for the specified scroll behavior

0 commit comments

Comments
 (0)