Robin S Posted February 26, 2018 Share Posted February 26, 2018 If I have a variable that might be a Page or a PageArray, is there an elegant way to standardise to a PageArray? In other words, if $foo is a Page convert it to a PageArray containing just that one page while keeping the variable name. I know how to do it in several steps, but I feel like I've seen a nice one-liner somewhere, maybe in a module by @adrian or @kongondo? Link to comment Share on other sites More sharing options...
Robin S Posted February 26, 2018 Author Share Posted February 26, 2018 Solved! if($foo instanceof Page) $foo = $foo->and(); Nice and tidy. 8 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