Velocity common grammar

  1. Variable: $ beginning, the first character must be a letter $ name => xiaoming
  2. Segmentation: {} , and the divided character string variable, $ {name} hello => xiaominghello
  3. Disclaimer: #set , #set ($ NUM = 0)
  4. Import Script: #parse (file path) public partial import
    #parse("views/dspadvert/common/body_footer.vm") 
  5. Double and single quotation marks, " $ name " => Xiaoming, ' $ name ' => '$ name'
  6. Script logo statement: #
                #foreach($info2 in $basicInfo2)
                    <li class="otherinfo-list">
                          $info2.value
                    </li>
                #end        
  7. Conditional statements
        #if ($ isHezhuo) ## partners: APP diversion 
            #set ($ linkFlag = "appdl") 
            #set ($ linkText = $ Phone) 
        #ElseIf ($ protectmp == "11" || $ protectmp == " 12 ") 
            #set ($ linkFlag =" sjbh ") 
            #set ($ linkText =" Privacy has enabled ") 
        #else 
            #set ($ linkFlag =" Phone ") 
            #set ($ linkText =" $ Phone ") 
        # end
  8. Notes: ## single-line comments # * . . . . * # Multiline comment
  9. Forced to nonexistent variables into empty: !
    #if($!guohufeiyong != "" && $!guohufeiyong == "53")
    

      

Guess you like

Origin www.cnblogs.com/longlongdan/p/11057846.html