File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ CHANGELOG
77 * Allow an array to be passed as the first argument to the ` importmap() ` Twig function
88 * Add ` TemplatedEmail::locale() ` to set the locale for the email rendering
99 * Add ` AppVariable::getEnabledLocales() ` to retrieve the enabled locales
10+ * Add ` impersonation_path() ` and ` impersonation_url() ` Twig functions
1011
11126.3
1213---
Original file line number Diff line number Diff line change @@ -69,7 +69,16 @@ public function getImpersonateExitPath(string $exitTo = null): string
6969 return $ this ->impersonateUrlGenerator ->generateExitPath ($ exitTo );
7070 }
7171
72- public function getImpersonatePath (string $ identifier = null ): string
72+ public function getImpersonateUrl (string $ identifier ): string
73+ {
74+ if (null === $ this ->impersonateUrlGenerator ) {
75+ return '' ;
76+ }
77+
78+ return $ this ->impersonateUrlGenerator ->generateImpersonationUrl ($ identifier );
79+ }
80+
81+ public function getImpersonatePath (string $ identifier ): string
7382 {
7483 if (null === $ this ->impersonateUrlGenerator ) {
7584 return '' ;
@@ -84,6 +93,7 @@ public function getFunctions(): array
8493 new TwigFunction ('is_granted ' , $ this ->isGranted (...)),
8594 new TwigFunction ('impersonation_exit_url ' , $ this ->getImpersonateExitUrl (...)),
8695 new TwigFunction ('impersonation_exit_path ' , $ this ->getImpersonateExitPath (...)),
96+ new TwigFunction ('impersonation_url ' , $ this ->getImpersonateUrl (...)),
8797 new TwigFunction ('impersonation_path ' , $ this ->getImpersonatePath (...)),
8898 ];
8999 }
You can’t perform that action at this time.
0 commit comments