html - Twig Set array value based on key -


I found similar questions like this here, but the answers from there do not help me.

> pre & lt; & Lt; TR & gt; & Lt; Th & gt; Permission & lt; / Th & gt; {% For role in roles}% th & gt; {{Role}} & lt; / Th & gt; {% Endfor%} & lt; / Tr & gt; {% Permission is allowed in%} {% if allowed. PermissionName! = CurrPerm%} {% if currPerm! = ''%} & Lt; Tr & gt; & Lt; Td class = "current-permission" & gt; {{CurrPerm}} & lt; / Td> %} For perm in {Permerray%} & lt; Td> {{Perm}} & lt; / Td> {% Endfor%} & lt; / Tr & gt; {% Endif%} {% set currPerm = permission.PermissionName%} {% set permArray = default%} {% endif%} {% set permArray [permission.RoleId] = '& amp; check;' %} {% Endfor%} & lt; Tr & gt; & Lt; TD & gt; {{CurrPerm}} & lt; / TD & gt; %} For perm in {Permerray%} & lt; Td> {{Perm}} & lt; / Td> {% Endfor%} & lt; / Tr & gt; & Lt; / Table & gt;

The above line is in the code

  {% set permArray [permission.RoleId] = '& amp; check;' %}  

While I have a problem setting the value for each key, in which I have tried to merge, but with any luck, this is just a new key for the array And this is all. If you have any other advice for this code, then I have all the ears.

You are not allowed to walk with

use you to do something like this Must do:

  {% set permArray [permission.RoleId] = permArray | Merge ({Permission.RoleId: '& amp; check;'})%}  

Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -