Improve dump function for NodeList and DomNode #320
No reviewers
Labels
No labels
Component: User interface
Component: Wymeditor
Help wanted
Level: Difficult
Level: Easy
Level: Moderate
Pagetype: Festival
Pagetype: Mailinglist
Pagetype: Peer reviewed article
Pagetype: Text
Privacy GDPR AVG
status: has conflicts
Status: Needs changes
Status: Needs discussion
Status: Needs review
Status: Ready to merge
Status: Waiting for response
Type: Bug
Type: Enhancement
Type: Question
Usecase: De Stadsbron
Usecase: Koppelting
Usecase: MeetjeStad
Value: Coders
Value: Security
Value: Users
Value: Visitors
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
harmen/hypha!320
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "improve-dump"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This makes some improvements to the
dump()function that logs values to the javascript console from PHP.In particular this improves the way that a
NodeListandDomNodeare dumped. For example,dump($hyphaXml->find('user'));would result in:This shows the nodeList with an expandable elements list, and each DomNode in the list is shown as a native Javascript DomNode, which can be traversed interactively.
Without this PR, dumping a
NodeListorDomNodewould just showObject { }in the console.@ -559,0 +571,4 @@if (is_array($var) && count($var) == 0)return '[]';// Keys all numeric and sequential? Non-associative arrayWay nicer!
Nice improvement
Rebased on top of master, merging next.