How to remove duplicated items in array on Twig

后端 未结 7 1048
-上瘾入骨i
-上瘾入骨i 2020-12-14 06:40

How to remove duplicated items in array on Twig?

I have array value in twig such as.

{{ set array = [\"testA         


        
7条回答
  •  一向
    一向 (楼主)
    2020-12-14 07:23

    The in operator performs containment test.

    It returns true if the left operand is contained in the right.

    {% if name in array %}
    

    http://twig.sensiolabs.org/doc/templates.html#containment-operator

提交回复
热议问题