PHP code in FatFree template
I have found the answer, although I don't really like it.
There is two different functions, F3::render()
and Template::serve()
With F3::render()
you can evaluate PHP expressions and use the F3::get()
to retrieve variables. According to the website: "The only issue with embedding PHP code in your templates is the conscious effort needed to stick to MVC principles"
The Template::serve()
is for templating only. Meaning its simply to process the templating language.
So basically, and yes it sucks and doesn't make sense, you can evaluate PHP code in the F3::render()
and you can't use templating variables ({{@var}}
) -OR- you can use Template::serve()
and you are limited to only calling PHP functions, and not truly evaluating PHP code.