desbest Posted October 18, 2017 Posted October 18, 2017 What is the difference between $pages->find() and $pages->get() ? They both look the same to me. Is ->get() for finding an individual page whereas find->() is for more than one? Also how do I find a page using a selector based on which user created the page? I couldn't find anything under Selectors documentation on how to do it.
abdus Posted October 18, 2017 Posted October 18, 2017 Find gives you multiple pages (actually a PageArray with zero or more pages) , and respects page status, whether it's hidden and access settings, while get gives you the page (a Page/NullPage object) disregarding access preferences. To find pages created by a particular user, you need $myUser = $users->get('admin'); $myPages = $pages->find("created_users_id=$myUser"); 3
kongondo Posted October 18, 2017 Posted October 18, 2017 1 hour ago, desbest said: What is the difference between $pages->find() and $pages->get() ? More info from the Docs Get: http://processwire.com/api/ref/pages/get/ Find: http://processwire.com/api/ref/pages/find/ 2
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