caribou Posted March 7, 2014 Share Posted March 7, 2014 Edit: Never mind. Simple typo on the equal signs. Carry on! Hello! I am trying to use $child->first() inside a loop, but I get the error "Error:Call to a member function first() on a non-object" Any pointer on what I'm doing wrong? Thanks! foreach($page->children->find("sort=-markerdate") as $child) { $current = $child->first(); if($child = $current){ $icon = $child->parent->icon->url; }else{ if ($child->icon != ""){ $icon = $child->icon->url; }else{ $icon = "image.png"; } } } 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now