Thinkphp file reference and analysis structure

Source: Internet
Author: User
1. import CSS and JS files 1. csslinkjsscr (linkrel & amp; #39; stylesheet & amp; #39; type & amp; #39; text/css & amp; #39; href & amp; #39 ;__ PUBLIC _/Css/test.css & amp; #3...

1. import CSS and JS files

1. css link

  1. Js scr
  2. (Link rel = 'stylesheet 'type = 'text/css 'href =' _ PUBLIC _/Css/test.css '/)
  3. (Script src = '_ PUBLIC _/Js/test. js') (/script)

2. import

  1. (Import type = 'js' file = 'JS. test'/) // Import test in the Js directory under the Public folder. js file. the import label can omit the type attribute. the default value is the js
  2. (Import type = 'css 'file = 'css. test'/) // The default value is the Public folder.
  3. // You can change the basepath attribute of the default folder.
  4. (Import type = 'js' file = 'JS. my' basepath = './Other '/)

3. load

// The method can automatically detect the imported file type

(Load href = '_ PUBLIC _/Js/test. js '/)

II. branch structure

1. if

  1. (If condition = '$ sex eq "male "')
  2. Men are made of mud.
  3. (Else /)
  4. Women are made of water.
  5. (/If)
  6.  
  7. (If condition = '$ age lt 18 ')
  8. Minor
  9. (Elseif condition = '$ age eq 18 '/)
  10. Young
  11. (Else /)
  12. Adult
  13. (/If)
  14. > Gt
  15. <Ltlt
  16. = Eq
  17. <= Elt
  18. > = Egt
  19. ! = Neq
  20. === Heq
  21. ! = Nheq
  22.  
  23. (Switch name = 'number') // remove the $ symbol of the variable in the loop.
  24. (Case value = '1') a monk picks up the water to eat (/case)
  25. (Case value = '2') two monk stations (/case)
  26. (Case value = '3') three monks without water (/case)
  27. (Default/) here is the default value
  28. (/Switch)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.