Given:
$column = array( 'value_1' => 'on', 'value_2' => 'on', 'value_3' => 'off' ); $values= array('value_1', 'value_2', 'value_3'); Non-working example:
{% for value in values %} <input type="checkbox" {% if column.{{value}} == 'on' %}checked{% endif %}> {% endfor %} The question is how to substitute the {{value}} variable into the condition? Maybe something like column.{value} , column.[value] , column.'value' ? But all this does not work. How to implement?
{{ column[value] }}tried? - Dmitriy Simushev