S
S
Sergey Beloventsev2018-03-14 14:23:48
Twig
Sergey Beloventsev, 2018-03-14 14:23:48

Why is for in not outputting data?

actually this is the code

{{ dump(options) }}
{% for options in option|e %}
   {{ dump(option['url']) }}
 {% endfor %}

I get this answer
array (size=4)
  0 => 
    array (size=2)
      'url' => string '464600' (length=6)
      'code' => string '46.46.00' (length=8)
  1 => 
    array (size=2)
      'url' => string '341967' (length=6)
      'code' => string '34.19.67' (length=8)
  2 => 
    array (size=2)
      'url' => string '255548' (length=6)
      'code' => string '25.55.48' (length=8)
  3 => 
    array (size=2)
      'url' => string '255544' (length=6)
      'code' => string '25.55.44' (length=8)

this array is the output of this code {{ dump(options) }}
and this code
{% for options in option|e %}
   {{ dump(option['url']) }}
 {% endfor %}

doesn't output anything why?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikolai Filippov, 2018-03-15
@Sergalas

{% for option in options %}
    {{ dump(option['url']) }}
{% endfor %}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question