My rewrite to Twig does not work. What is wrong?
PHP source:
<?php foreach ($datas as $data) { ?>
<?php if ($data['information_id'] == $info_id) { ?>
<a href="<?php echo $data['href']; ?>" class="list-group active"><?php echo $data['title']; ?></a>
<?php } else { ?>
<a href="<?php echo $data['href']; ?>" class="list-group"><?php echo $data['title']; ?></a>
<?php } ?>
<?php } ?>
Rewrite to Twig:
{% for datas in data %}
{% if {{ attribute(data,information_id) }} == info_id %}
<a href="{{ data.href }}" class="list-group active">{{ data.title }}</a>
{% else %}
<a href="{{ data.href }}" class="list-group">{{ data.title }}</a>
{% endif %}
{% endfor %}