Adam Kiss Posted August 4, 2012 Share Posted August 4, 2012 Hey Ryan (and few of those 'I know core' devs ) I am doing little something, and I'd really like to get to the data user assigned to $page during template processing. If I do this, for instance: $page->custom_value = 'test'; I can get the information about 'custom_value' existence from the $page object in both $page->data and $page->changes; Unfortunately, both of them are protected. Of course data is even better, because there is value as well, but I thought that if I had the name even, I could get to content. Is there any way around this? Thanks Link to comment Share on other sites More sharing options...
ryan Posted August 4, 2012 Share Posted August 4, 2012 You can call the getChanges() method on any object in ProcessWire and it'll return a plan array of field names that changed. So what I think you are looking for is $page->getChanges(). This assumes that change tracking is enabled for the page (which it usually is). $page->setTrackChanges(true); // true to turn ON, false to turn OFF $page->resetTrackChanges(true); // clear the change log and start tracking again $changes = $page->getChanges(); Link to comment Share on other sites More sharing options...
Adam Kiss Posted August 4, 2012 Author Share Posted August 4, 2012 Fantastic, thanks! 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