0

I use October CMS/Laravel in this case.

I have a form I send data to the next page (redirect after Submit).

On the next page I use:

function onStart(){
    $this['members'] = (isset($_POST['members'])) ? $_POST['members'] : array(); 
}

and after that I do iterate it like this:

{% for member in members %}          
       {{ member }}
{% endfor %}

and I can see the result successfully like this:

{"id":2,"name":"test000","country":"","city":"test","address":"\u041f\u043e\u043f\u043e\u0432\u0430, 100","zipcode":"10998","phone":"397267786","email":"ww@ww.ww","permissions":null,"is_activated":true,"activated_at":"2022-06-29 22:23:18","last_login":"2022-07-04 09:57:09","created_at":"2022-06-29 22:23:18","updated_at":"2022-07-04 11:39:29","username":"ww@ww.ww","surname":null,"deleted_at":null,"last_seen":"2022-07-04 09:53:53","is_guest":0,"is_superuser":0,"created_ip_address":"180.183.230.180","last_ip_address":"127.0.0.1"} 

{"id":3,"name":"\u0410\u043b\u0435\u043a\u0441\u0430\u043d\u0434\u0440\u0430","country":"","city":"","address":"","zipcode":"","phone":"","email":"aaa@aaa.ru","permissions":null,"is_activated":true,"activated_at":"2022-06-29 22:30:53","last_login":"2022-06-30 00:26:43","created_at":"2022-06-29 22:30:53","updated_at":"2022-06-30 00:27:07","username":"aaa@aaa.ru","surname":"","deleted_at":null,"last_seen":"2022-07-02 05:57:11","is_guest":0,"is_superuser":0,"created_ip_address":"78.25.135.90","last_ip_address":"78.25.135.90"} 

but when I'm trying to parse data like this:

{% for member in members %}          
       {{ member.name }}
{% endfor %}

or ANY another value:

{% for member in members %}          
       {{ member.id }}
{% endfor %}

I see no any results.

DarkBee
  • 16,592
  • 6
  • 46
  • 58
yuqi
  • 1
  • That's not an array that's a json string. U'll have to decode it first – DarkBee Jul 14 '22 at 05:37
  • Does this answer your question? [Decoding JSON in Twig](https://stackoverflow.com/questions/14500698/decoding-json-in-twig) – DarkBee Jul 14 '22 at 05:37

0 Answers0