alkahest Posted October 1, 2013 Share Posted October 1, 2013 Is there a way to do a var_dump() in PW without getting a massive incomprehensible array returned? The amount of data that's inside the object is so extensive that it often crashes the browser. Is there a wrapper function that's just for debugging? Link to comment Share on other sites More sharing options...
Wanze Posted October 1, 2013 Share Posted October 1, 2013 Depends on the variable you put in var_dump Can you tell what do you want to achieve, debug? Link to comment Share on other sites More sharing options...
alkahest Posted October 1, 2013 Author Share Posted October 1, 2013 Well, I have something as simple as a list of US states and their children (which are Schools). The US states just have a title, as do the Schools. I have looped through all the states and split them into two arrays for display purposes. All I want to do is var_dump the array that contains the objects, but PW spits out an insane 20 page novel about the contents of the states and their children. Link to comment Share on other sites More sharing options...
Pete Posted October 1, 2013 Share Posted October 1, 2013 You can do this on any PageArray: echo $yourresults->getArray(); Taken from here: http://cheatsheet.processwire.com/ (you'll need to click on "advanced" at the top to see this though. Link to comment Share on other sites More sharing options...
alkahest Posted October 1, 2013 Author Share Posted October 1, 2013 So, when I try: $state_set = $pages->find('template=state'); echo $state_set->getArray(); I get Array(); as the output. If I try: var_dump($state_set->getArray()); I get Proust. Link to comment Share on other sites More sharing options...
diogo Posted October 1, 2013 Share Posted October 1, 2013 You can also use Soma's http://modules.processwire.com/modules/chrome-php-logger/ to have all the info in more organized way 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