<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                ### 12.3.2 關系和邏輯操作符 Velocity 使用等式操作符來決定兩個變量間的關系。這里是一個簡單的例子演示如何使用等式操作符: ``` #set ($foo = "deoxyribonucleic acid") #set ($bar = "ribonucleic acid") #if ($foo == $bar) In this case it's clear they aren't equivalent. So... #else They are not equivalent and this will be the output. #end ``` Velocity 也具有邏輯AND, or 和 NOT 操作符。更進一步的信息,請看VTL參考手冊VTL Reference Guide 。下面是一些演示如何使用邏輯操作符的例子: ``` ## logical AND #if( $foo && $bar ) <strong> This AND that</strong> #end ``` 例子中\#if() 指令僅在$foo 和$bar 斗為真的時候才為真。如果$foo 為假,則表達式也為假;并且 $bar 將不被求值。如果 $foo 為真,Velocity 模板引擎將繼續檢查$bar;的值,如果 $bar 為真,則整個表達式為真。并且輸出This AND that 。如果 $bar 為假,將沒有輸出因為整個表達式為假。 邏輯OR 的工作方式相同,唯一的例外是其中一個表達式要被求值,以便決定整個表達式是否為真。請看下面的例子: ``` ## logical or #if( $foo || $bar ) <strong>This or That</strong> #end ``` 如果 $foo 為真,Velocity 模板引擎就不需要去察看$bar 的值,不管 $bar 是否為真,真個表達式都為真,因此輸出This or That 。如果 $foo 為假,$bar 就必須檢查其值了。在這種情況下,如果$bar 也是為假,表達式將為假,沒有任何輸出。當然,如果$bar 為真,則真個表達式為真,輸出This or That。 對于邏輯NOT 操作符,只有一個操作數: ``` ##logical NOT #if( !$foo ) <strong>NOT that</strong> #end ``` 這里,如果$foo 為真,!$foo 求值為假,沒有輸出。如果$foo 為假,!$foo 求值為真,輸出NOT that 。請當心,不要和安靜引用quiet reference $!foo 混淆它們是完全不同的。
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看