fatfree icon indicating copy to clipboard operation
fatfree copied to clipboard

@variable ?? ''

Open noxtras opened this issue 1 year ago • 1 comments

In the templating engine, I always have to do this: {{@var ?? ''}} Is there a way to have it done directly by F3? so even in php8.2 i can still just write {{@var}} ?

Thanks.

noxtras avatar Jan 20 '24 13:01 noxtras

The trick is to define all vars you try to use in a template. If there's no chance to ensure this, you could use the error control operator @ to skip reporting the missing variable, i.e. {{ @@var }}

ikkez avatar Jan 30 '24 11:01 ikkez