I have try to converted my php code to Twig code.
Php code:
<?php foreach ($languages as $language) {
if(empty($my_title[$language["language_id"]])){$my_title[$language["language_id"]] ="MY Title";}
?>
to Twig:
{% for language in languages %}
{% if not my_title[language.language_id] %}
{% set my_title[language.language_id] = "MY Title" %}
{% endif %}
{% endfor %}
but, Does get following error.
Fatal error: Uncaught exception 'Twig_Error_Syntax' with message 'Unexpected token "punctuation" of value "[" ("end of statement block" expected) in....
what do wrong here? how to write properly this code in twig?