Skip to content

Looping through Timber\Menu in PHP. Possible? I'm getting weird results. #2764

Closed Answered by KingWebsites
KingWebsites asked this question in Q&A
Discussion options

You must be logged in to vote

Just to add to this. I think it may just be an issue with how PHP's print_r() works with the Timber\Menu object. I've managed to successfully do what I need by using the following loop:

foreach ($menu_obj_items as $item) {
	foreach ($item->children as $child) {
	}
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by KingWebsites
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant