そこで、PHP の stdClass() オブジェクトを Smarty に渡します。たとえば、次のようになります。
stdClass Object
(
[1] => stdClass Object
(
[id] => 1
[children] => stdClass Object
(
[4123] => stdClass Object
(
[id] => 4123
[children] => stdClass Object
(
[221] => stdClass Object
(
[id] => 221
[children] => stdClass Object
(
)
),
[55] => stdClass Object
(
[id] => 55
[children] => stdClass Object
(
)
)
)
),
[666] => stdClass Object
(
[id] => 666
[children] => stdClass Object
(
)
)
)
)
)
各オブジェクトには、同じ構造を持つ ID と子があります。次のようにすべての id-s を再帰的に出力するにはどうすればよい1, 4123, 221, 55, 666
ですか?