Skip to content

Commit 00f510f

Browse files
committed
Refactor: centralize SITE_URI usage in Twig global and update router default URI configuration
1 parent bc6e233 commit 00f510f

4 files changed

Lines changed: 3 additions & 4 deletions

File tree

config/packages/framework.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ framework:
88

99
#esi: true
1010
#fragments: true
11-
router:
12-
default_uri: '%env(SITE_URI)%'
1311

1412
when@test:
1513
framework:

config/packages/routing.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ framework:
22
router:
33
# Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
44
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
5-
#default_uri: http://localhost
5+
default_uri: '%env(SITE_URI)%'
66

77
when@prod:
88
framework:

config/packages/twig.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ twig:
22
file_name_pattern: '*.twig'
33
globals:
44
google_maps_api_key: '%env(GOOGLE_MAPS_API_KEY)%'
5+
site_uri: '%env(SITE_URI)%'
56
form_themes: ['@TalesFromADevFlowbite/form/default.html.twig']
67

78

templates/email.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
<p>Wir empfehlen, in Kürze erneut nach Updates zu schauen.</p>
1313

1414
<p>Um weitere Änderungen vorzunehmen, nutze bitte die folgende URL:<br>
15-
<a href="{{ url('app_stall_edit', {uuid: stall.privateUuid}) }}">{{ url('app_stall_edit', {uuid: stall.privateUuid}) }}</a></p>
15+
<a href="{{ site_uri ~ path('app_stall_edit', {uuid: stall.privateUuid}) }}">{{ site_uri ~ path('app_stall_edit', {uuid: stall.privateUuid}) }}</a></p>
1616

1717
<h2>Tipps für einen tollen Tag als Standbetreiber*in</h2>
1818

0 commit comments

Comments
 (0)