Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试处理未定义变量的控制案例。
这似乎有效,但也很丑陋。有什么方法可以使这项工作更好吗?
<!-- IF UNASSIGNED_VARIABLE --> <!-- ELSE --> <insert code here> <!-- END -->
我尝试了几种不同的否定结构,但它们仅在定义模板变量时才有效。
wiki上描述了常见的运算符
<!-- IF not UNASSIGNED_VARIABLE --> <insert code here> <!-- END -->