Is there a better way to hide a variable in the template

46 views
Skip to first unread message

noXTRAs

unread,
May 9, 2019, 6:02:11 AM5/9/19
to Fat-Free Framework
HI,
Is there a better way to hide a variable in the template than doing:

{{(@subtotal = 0) ? '' : '' }}
and
{{ (@subtotal += @product.price*@product.qty) ? '' : '' }}


Paul Herring

unread,
May 9, 2019, 6:20:17 AM5/9/19
to noXTRAs via Fat-Free Framework, Fat-Free Framework
{~ @subtotal = 0; ~}

--
-- You've received this message because you are subscribed to the Google Groups group. To post to this group, send an email to f3-fra...@googlegroups.com. To unsubscribe from this group, send an email to f3-framework...@googlegroups.com. For more options, visit this group at https://groups.google.com/d/forum/f3-framework?hl=en
---
You received this message because you are subscribed to the Google Groups "Fat-Free Framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to f3-framework...@googlegroups.com.
To post to this group, send email to f3-fra...@googlegroups.com.
Visit this group at https://groups.google.com/group/f3-framework.
To view this discussion on the web visit https://groups.google.com/d/msgid/f3-framework/fe5dd28c-b8e4-4219-bf3c-5011d7888659%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

noXTRAs

unread,
May 9, 2019, 6:30:45 AM5/9/19
to Fat-Free Framework
Thanks!!!

PJH

unread,
May 9, 2019, 9:35:50 AM5/9/19
to Fat-Free Framework


On Thursday, May 9, 2019 at 11:30:45 AM UTC+1, noXTRAs wrote:
Thanks!!!


To expound on this (I was on mobile before,) the only reference I can easily find in the documentation about this is the following:


The Preview class mainly takes care about converting your template and its expressions to PHP code - the so called pre-compiled template. So any tokens that are echo'd {{ }} or just executed {~ ~} can be used for dynamic templating, not just with HTML markup, but also with non-XML compatible template system like HAML, YAML, markdown or simple text files.

ikkez

unread,
May 11, 2019, 4:25:11 AM5/11/19
to Fat-Free Framework

noXTRAs

unread,
May 11, 2019, 5:31:10 AM5/11/19
to Fat-Free Framework
Thank you. I'm on the documentation page daily, yet I never found this part...
Reply all
Reply to author
Forward
0 new messages