Yii var dumper wrapper
function dumper(){
$bt = debug_backtrace();
$file = $bt[0]['file'].':'.$bt[0]['line'];
$args = func_get_args();
if(count($args)==0 && isset($bt[1]))
$args[] = $bt[1];
foreach($args as $arg){
echo '<pre style="position:relative;">';
echo '<span style="color:#777; right:10px; position:absolute;">'.$file.'</span>';
CVarDumper::dump($arg, 10, true);
echo '</pre>';
}
}
Usage:
dumper($variable);
dumper($var1, $var2, $var3);
When no parameters are added info on the current location of the dumper is given:
dumper();
Written by Ilko
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Php
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#