I am trying to work with FatFree framework and trying to use the template engine. I render the template with the following code -
echo Template::serve('template.php');
The problem which I'm facing is that, inside the template.php file the F3 tags are recognised but any PHP code doesn't work. For instance, if I have the following code in the template.php file -
<?php
if (F3::get('var') == 'var1') {
?>
<span>var1 is present</span>
<?php
} else {
?>
<span>var1 not present</span>
<?php
}
?>
Here both var1 is present
and var1 not present
is printed irrespective of the value of var. Also, php for loops are not working - so basically all the php code is not working.
However, if I used <F3:check>
to write the above PHP code, then everything works fine. Can we not use PHP code in templates. If this is the case, this is a serious limitation.