- Joined
- May 15, 2020
- Messages
- 23
- Reaction score
- 7
Hello
As in the title.
Passing null to the function will throw an error:
To avoid this, you use the following condition in your template:
It seems to me that this is not the best solution. I would pass a
As in the title.
Passing null to the function will throw an error:
[E_WARNING] Attempt to read property "length_unit" on null
To avoid this, you use the following condition in your template:
Code:
{{ $active.Uud ? phrase_duration($active.Uud) : $upgrade.cost_phrase }}
It seems to me that this is not the best solution. I would pass a
UserUpgradeActive
object to the function and calculate the phrase based on start_date
and end_date
.