NEW: Hooks tab in debugbar (#24992)

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
jyhere
2024-04-09 03:09:10 +02:00
committed by GitHub
parent 58e0837a7a
commit 4880ec1b77
6 changed files with 173 additions and 2 deletions

View File

@@ -72,4 +72,29 @@
});
})(PhpDebugBar.$);
/**
* An extension of KVListWidget where the data represents a list
* of variables
*
* Options:
* - data
*/
var HookListWidget = PhpDebugBar.Widgets.HookListWidget = PhpDebugBar.Widgets.KVListWidget.extend({
className: csscls('widgets-kvlist widgets-hooklist'),
itemRenderer: function(dt, dd, key, object) {
$('<span />').attr('title', key).text(key).appendTo(dt);
dd.html('<span><strong>File: </strong> ' + object.file
+ '</span><span><strong>Line: </strong>' + object.line
+ '</span><span><strong>Count: </strong>' + object.count
+ '</span><span><strong>Contexts: </strong>' + (object.contexts === null || object.contexts === '' ? 'Not set' : object.contexts)
+ '</span>'
);
}
});
})(PhpDebugBar.$);