內容簡介
在建立自定義佈景主題或外掛時,經常需要查看正在處理的資料,這可能會讓人感到不便和難看。
此外掛會添加一個新的標籤到Debug Bar外掛中,讓您可以將數據“追踪”到一個窗口並顯示不僅是數據,還有呼叫來自何處和可選的描述。
此外,這個外掛有綠色的網格。
關於debug_trace
方法debug_trace()接受一個可以是任何資料類型的參數。
如果您要傳遞debug_trace()的描述符,請傳遞一個具有以下索引的陣列:
‘key’ => 描述符
‘data’ => 您要追踪的內容,可以是任何資料類型。
在幕後,每個追踪實際上是一個陣列,其中包含呼叫位置、資料和可選的自定義鍵。
如果傳遞給debug_trace()的參數是具有‘ key ’或‘ data ’鍵的陣列,則該方法使用它來覆蓋默認值。
否則,該方法假定您要將傳遞的參數作為‘ data ’追踪。
外掛標籤
開發者團隊
原文外掛簡介
Many times when creating a custom theme or plugin there is need to view a piece of data you are working with which can be unweidly and not to mention ugly.
This plugin adds a new tab to the Debug Bar plugin that allows you to “trace” the data to a window and displays not only the data, but where the call came from and optionally a description.
Plus, it’s green like the Matrix.
About debug_trace
The method debug_trace() takes one parameter that can be of any data type.
If you want to pass a descriptor for the debug_trace(), pass an array with the following indices:
‘key’ => The descriptor
‘data’ => What you want to trace – can be any data type.
Behind the scenes, each trace is actually an array containing the location of the call, the data and optionally a custom key.
If the parameter passed to debug_trace() is an array that has a key of ‘key’ or ‘data’, then the method overrides the defaults with it.
Otherwise, the method assumes you want to trace the passed parameter as the ‘data’.
