<check elseif="{{ isset(@message) }}"> ??

57 views
Skip to first unread message

s.hosein Hoseini

unread,
May 8, 2017, 8:31:44 AM5/8/17
to Fat-Free Framework

how can i use   else if or case  in template

lbj

unread,
May 8, 2017, 8:39:10 AM5/8/17
to f3-fra...@googlegroups.com
Something like this should work :

   <check if="{{ @user AND isset(@SESSION[password_required]) AND @last_order==0 AND @last_operation<>''}}">
        <true>
               <button type="button" class="btn btn-info btn-lg btn-block"><strong>{{ @user }} Order 0 {{@operation}}: {{@last_operation_text}}</strong></button>
        </true>
        <br>
        <false>
              <button type="button" class="btn btn-danger btn-lg btn-block"><strong>{{ @user }} {{@pause_set}}</strong></button>
        </false>
   </check>



Den 08-05-2017 kl. 14:31 skrev s.hosein Hoseini via Fat-Free Framework:

how can i use   else if or case  in template
--
-- 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/1ebcb0ee-d863-4aad-8c29-bf89d343b329%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

s.hosein Hoseini

unread,
May 8, 2017, 8:47:53 AM5/8/17
to Fat-Free Framework
<true>something</true>     
<false>something</false>

just mean else no "else if"

so we can <check> in the <false></false> tag but i need direct and neat solution

Best regards,

lbj

unread,
May 8, 2017, 9:09:22 AM5/8/17
to s.hosein Hoseini via Fat-Free Framework
<switch expr="{{ scalar expr }}">
    <case value="{{ scalar @value|expr }}" break="{{ bool TRUE|FALSE }}">
        text-block
    </case>
    .
    .
    .
    <default>
        message
    </default>
</switch>
--
-- 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.

ved

unread,
May 8, 2017, 9:33:48 AM5/8/17
to Fat-Free Framework
You can also use the simpler (imho) tags provided by the Preview class (that the Template class extends) and use something like:

{~ if(@something): ~}

   
<p>cool</p>

{~ elseif(@somethingelse): ~}

    <p>cooler</
p>

{~ else: ~}

   
<p>not cool</p>

{~ endif; ~}


Reply all
Reply to author
Forward
0 new messages