タイトルが示唆しているように、関数があります。配列にいくつかの変更を加えます(この配列は私のパラメータです)。次に、実際の配列のコピーを使用していることに気付きました。
コピーではなく実際の配列を取得する方法があったことは知っていますが、それは何でしたか? 事前にすべてありがとう、私はあなたがこれをすぐに解決することを知っています:)
使っているところはこちら
function findChildren($listOfParents)
{
static $depth=-1;
$depth++;
foreach ($listOfParents as $thisParent)
{
$thisParent->title = str_repeat(" >", $depth) . $thisParent->title;
$children = page::model()->findAll(array('condition'=>'parent = ' . $thisParent->id));
findChildren($children);
}
$depth--;
}
したがって、彼のコピーではなく、この $listOfParents が必要です。