[eluser]TheJim[/eluser]
[quote author="tomdelonge" date="1271275512"]
This is in my foreach loop:
Code:
foreach($ys->all as $y)
{
$x->y->include_join_fields()->get();
$value = $x->y->join_value;
echo $value;
}
[/quote]
I don't have a lot of time to try to set up something similar and make sure I know exactly what you're getting at, but what is clear is that you're not using $y, which is of course the changing value.
So, I would think that at least you'd want
Code:
foreach($ys->all as $y)
{
$y->x->include_join_fields()->get();
$value = $y->x->join_value;
echo $value;
}
That is, switching the y and the x (assuming x is also your model name and not just a variable name).
And of course I don't really know what you're doing, but in all likelihood you could set up your query such that you don't have to do another get() in the loop. That's a separate issue though.