Robin S Posted March 28, 2017 Share Posted March 28, 2017 I'm working on a module where I iterate over all fields in a template, and wanting to minimise the number of different field value types I need to account for. Is there a way to get the value of a 'single' Page field as a PageArray, so the value of the field is of the same type as a 'multiple' Page field? With single/multiple Image and File fields I can use getUnformatted() to ensure I always get the field value as a WireArray. I thought there might be something similar possible for Page fields. Link to comment Share on other sites More sharing options...
BitPoet Posted March 28, 2017 Share Posted March 28, 2017 <?php $pagearr = $pages->newPageArray()->add($page->myfield); 1 Link to comment Share on other sites More sharing options...
Robin S Posted March 28, 2017 Author Share Posted March 28, 2017 Cool, thanks @BitPoet. 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