PHP code example of lekoala / silverstripe-debugbar
1. Go to this page and download the library: Download lekoala/silverstripe-debugbar library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
lekoala / silverstripe-debugbar example snippets
DebugBar::trackTime('create_request');
$request = HTTPRequestBuilder::createFromEnvironment();
// This line is optional : you can close it or it will be closed automatically before pre_request
DebugBar::trackTime('create_request');
define('FRAMEWORK_BOOT_TIME', microtime(true));
d($myvar, $myothervar);
d($myDataList->sql());
l('My message');
putenv('DEBUGBAR_DISABLE=true');
protected function init()
{
parent::init();
Requirements::javascript('framework/thirdparty/jquery/jquery.min.js');
}
protected function init()
{
parent::init();
Requirements::block("//code.jquery.com/jquery-3.3.1.min.js");
}
public function my_action()
{
DebugBar::suppressJquery();
Requirements::javascript("//code.jquery.com/jquery-3.3.1.min.js");
Requirements::javascript("my.plugin.js");
return $this;
}