Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
Static Public Member Functions | List of all members
CVarDumper Class Reference

Static Public Member Functions

static dump ($var, $depth=10, $highlight=false)
static dumpAsString ($var, $depth=10, $highlight=false)

Detailed Description

Definition at line 26 of file CVarDumper.php.

Member Function Documentation

static CVarDumper::dump (   $var,
  $depth = 10,
  $highlight = false 
)
static

Displays a variable. This method achieves the similar functionality as var_dump and print_r but is more robust when handling complex objects such as Yii controllers.

Parameters
mixed$varvariable to be dumped
integer$depthmaximum depth that the dumper should go into the variable. Defaults to 10.
boolean$highlightwhether the result should be syntax-highlighted

Definition at line 40 of file CVarDumper.php.

References dumpAsString().

{
echo self::dumpAsString($var,$depth,$highlight);
}
static CVarDumper::dumpAsString (   $var,
  $depth = 10,
  $highlight = false 
)
static

Dumps a variable in terms of a string. This method achieves the similar functionality as var_dump and print_r but is more robust when handling complex objects such as Yii controllers.

Parameters
mixed$varvariable to be dumped
integer$depthmaximum depth that the dumper should go into the variable. Defaults to 10.
boolean$highlightwhether the result should be syntax-highlighted
Returns
string the string representation of the variable

Definition at line 54 of file CVarDumper.php.

Referenced by dump().

{
self::$_output='';
self::$_objects=array();
self::$_depth=$depth;
self::dumpInternal($var,0);
if($highlight)
{
$result=highlight_string("<?php\n".self::$_output,true);
self::$_output=preg_replace('/&lt;\\?php<br \\/>/','',$result,1);
}
return self::$_output;
}

The documentation for this class was generated from the following file: