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.
ビューで配列を取得し、変数の名前 (文字列) しか知りません。
私はそれを評価する必要があります。
どのようにできるのか?
Twig には可変変数はありませんが、その問題をソートする twig 拡張機能/フィルターを作成できます。それほど難しくはありません。
これを使用していない場合に備えて、これを行う方法を次に示します。
http://symfony.com/doc/current/cookbook/templating/twig_extension.html