Answer the question
In order to leave comments, you need to log in
Why does twig json_encode return {"?
Hello.
There is an array at the input:
Array
(
[1] => Moscow
[2] => St. Petersburg
[3] => Novosibirsk
[4] => Yekaterinburg
[5] => Nizhny Novgorod
[6] => Kazan
[7] = > Chelyabinsk
[8] => Omsk
[9] => Samara
[10] => Rostov-on-Don
[11] => Ufa
[12] => Krasnoyarsk
[13] => Perm
[14] => Voronezh
[15 ] => Volgograd
[16] => Krasnodar
[17] => Saratov
[18] => Tyumen
[19] => Togliatti
[20] => Izhevsk
[21] =>
[23] => Ulyanovsk
[24] => Khabarovsk
[25] => Yaroslavl
[26] => Makhachkala
[27] => Tomsk
[28] => Orenburg
[29] => Kemerovo
[30] => Novokuznetsk
[31 ] => Ryazan
[32] => Astrakhan
[33] => Naberezhnye Chelny
[34] => Penza
[35] => Lipetsk
[36] => Kirov
[37] => Tula
[38] => Cheboksary
[39] => Kaliningrad
[40] => Kursk
[41] => Ulan-Ude
[42] => Not selected
) Template
code:
let cities_info = {{ json|json_encode(constant('JSON_UNESCAPED_UNICODE')) }}
At the output I get this:
How to avoid and what am I doing wrong?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question