bcosca / fatfree

A powerful yet easy-to-use PHP micro-framework designed to help you build dynamic and robust Web applications - fast!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@variable ?? ''

noxtras opened this issue · 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.

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 }}