If else embedding inside html

前端 未结 5 1561
情话喂你
情话喂你 2020-12-12 15:35

What is the correct way of embedding if else and elseif conditions inside html?

5条回答
  •  忘掉有多难
    2020-12-12 16:10

    I recommend the following syntax for readability.

    
      

    Content

    Other Content

    Default Content

    Note, omitting php on the open tags does require that short_open_tags is enabled in your configuration, which is the default. The relevant curly-brace-free conditional syntax is always enabled and can be used regardless of this directive.

提交回复
热议问题