我看到这样一个代码
 <!--{if $child.cat_id and $current_cat_t_id eq $child.id}-->
  我不理解 if *** and *** eq ***  这代表什么意思。 

解决方案 »

  1.   

    {if $child.cat_id and $current_cat_t_id eq $child.id}
    这是smarty的吧怎么看不懂
    就是跟 
    {if $child.cat_id && $current_cat_t_id == $child.id}
    一样 
      

  2.   

    确实用的应该是模板,现在的模板都这样
    第一个and就不说,楼主估计知道什么意思
    这里说说eq,其实equals(==)的简写,相当与"=="
    这里给一个全面参考   
    算术运算符 + 、 - 、 * 、 / (或 div )和 % (或 mod )   
    关系运算符 == (或 eq )、 != (或 ne )、 < (或 lt )、 > (或 gt )、 <= (或 le )和 >= (或 ge )   
    逻辑运算符 && (或 and )、 || (或 or )和 ! (或 not )   
    验证运算符 empty