Added 4th parameter to dBug constructor.
With this optional parameter, that is false by default, you can trigger the init of the JS and CSS. This is needed if you want to use dBug multiple time to e.g. create multiple files (using ob_start etc. ). Until now it would only generate those sections on the first constructor call.
This commit is contained in:
parent
4a1bb162c0
commit
07c3deaeb5
1 changed files with 7 additions and 5 deletions
12
dBug.php
12
dBug.php
|
@ -66,12 +66,14 @@ class dBug {
|
|||
var $arrHistory = array();
|
||||
|
||||
//constructor
|
||||
function dBug($var,$forceType="",$bCollapsed=false) {
|
||||
function dBug($var,$forceType="",$bCollapsed=false, $reinit = false) {
|
||||
//include js and css scripts
|
||||
if(!defined('BDBUGINIT')) {
|
||||
define("BDBUGINIT", TRUE);
|
||||
$this->initJSandCSS();
|
||||
}
|
||||
if(!defined('BDBUGINIT') || $reinit) {
|
||||
if(!defined('BDBUGINIT')){
|
||||
define("BDBUGINIT", TRUE);
|
||||
}
|
||||
$this->initJSandCSS();
|
||||
}
|
||||
$arrAccept=array("array","object","xml"); //array of variable types that can be "forced"
|
||||
$this->bCollapsed = $bCollapsed;
|
||||
if(in_array($forceType,$arrAccept))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue