私は symfony を勉強していて、twig テンプレートに変数を表示したいと思っています。ここに私のPHPコードがあります:
{% for row in issue.data %}
{{ dump(row) }}
そして、私が自分のサイトで得たもの:
array(size=5)
'positionId' =>int5
'position' =>int5
'cost' =>float3000
'detailIndex' =>int1
'hours' =>int3
だから私は使用しています:
{{ row.detailIndex }}
私の配列変数にアクセスするには、エラーが発生しました:
Item "detailIndex" for "Array" does not exist in
この変数に簡単にアクセスできるため、これは非常に奇妙です。
{{ row.hours }}
{{ row.position }}
{{ row.cost }}
私はあなたの助けに感謝します、私の友達!