if else in template

445 views
Skip to first unread message

John Fishworld

unread,
Oct 24, 2013, 10:35:13 AM10/24/13
to f3-fra...@googlegroups.com
hi,

I have this in my template
        <php if( {{@SESSION.lang }} == 'de') { ?>
                    XX
                <?php } else { ?>
                    ZZ
                 <?php } ?>

and set in my controller
        $this->f3->set('SESSION.lang','de');

So can anyone say why i see both
XX
and
ZZ

? thanks

ikkez

unread,
Oct 24, 2013, 10:59:24 AM10/24/13
to f3-fra...@googlegroups.com
using a template (Template Class) does not accept php statements in your template file. That's why it's just renderes as simple html <php ...> tag and that's why you see both.

what you need it the <check> conditional statement in your template, see here: http://fatfreeframework.com/quick-reference#check
Reply all
Reply to author
Forward
0 new messages