Hello,
I would like to add a new key to my find result, so i do :
$responses = Response::find();
foreach ($responses as $key => $value) {
$dependance = Dependance::find([
'id_dependance = :id_dependance:',
'bind' => [
'id_dependance' => $responses[$key]->id
]
]);
$responses[$key]->Dependance = $dependance;
But if i do this in volt :
{% for response in responses %}
{{ response.Dependance[0]->id }}
<?php property_exists($response, 'Dependance') ? print 'true': print 'false'; ?>
{% endfor %
The first doesn't show anything, and the second returns false all time. I've check that the Dependance::find retunr s a result, and it does.
So how do i modify the result of a find to add a new key ??