may be someone can explain me what i am goting wrong.
I get response from riak bucket, which i prepare in action controller and render the response in twig. But i can not iterate over the response with loop in twig.
When i do that in twig:
{%% for callback in callbacks %}
{{ dump(callback) }}
{% endfor %}
I get this:
Doc {#410 ▼
#data: {#422 ▼
+"psStatus_i": 0
+"psUrl_s": ""
+"clickId_s": "1_3_4_f1a9bcf2faaa2ef67a39916ba06cbbb0"
+"id_s": "565f04da60030fa3048b4572"
}
#_yz_id:1*CallBackDataIn_all*all*1_3_4_f1a9bcf2faaa2ef67a39916ba06cbbb0*24"
}
but when i want to get explicit one field like:
{{ callback.id_s }}
i get then:
Method "id_s" for object "Basho\Riak\Search\Doc" does not exist
I try to cast to array bvt then i get array to string exception.
Any idea, what i am doing wrong.
EDIT: This is output with var_dump() in php:
object(Basho\Riak\Search\Doc)[410] protected 'data' =>
object(stdClass)[422]
public 'psStatus_i' => int 0
public 'psUrl_s' => string '' (length=0)
public 'clickId_s' => string '1_3_4_f1a9bcf2faaa2ef67a39916ba06cbbb0' (length=38)
public 'id_s' => string '565f04da60030fa3048b4572' (length=24)
protected '_yz_id' => string '1*CallBackDataIn_all*all*1_3_4_f1a9bcf2faaa2ef67a39916ba06cbbb0*25' (length=66)
protected '_yz_rk' => string '1_3_4_f1a9bcf2faaa2ef67a39916ba06cbbb0' (length=38)
{{ callback.data.id_s }}
– Matteoattribute(callback, 'id_s')
will do the trick? – Vasily{{ callback.__get('id_s') }
– Matteo