{% extends '::baseAjax.html.twig' %} {% block ajax_body %} {% set total_charge = 0 %} {% for charge in chargesArr %} {% set total_charge = total_charge + charge.charge %} {% endfor %} {{ total_charge }} {% endblock ajax_body %}