-
-
Notifications
You must be signed in to change notification settings - Fork 36
Simplify inline conditions with ?? operator #389
Copy link
Copy link
Open
Description
Would it be possible to do some optimizations like replacing:
{{ user and user.locationCountry.value ?? '' }}and change it to
{{ user.locationCountry.value ?? '' }}The initial code was written because user can be null and it's chaining multiple levels deep is not expected to work.
But the ?? operator in Twig takes care of this already.
{{ blaat.test.something.else.whatever ?? '' }}is perfectly valid.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels