Welcome Guest, Not a member yet? Register   Sign In
Undefined valuable
#14

(05-11-2017, 04:28 AM)kayinja.denis Wrote:
(05-10-2017, 12:06 PM)InsiteFX Wrote: Here is a nice method to format var_dump values.

PHP Code:
/**
 * varDebug Helper - place in a helper file.
 * 
 * Formats the output of var_dump();
 * 
 */
if ( ! function_exists('varDebug'))
{
    
/**
     * Debug Helper
     * ----------------------------------------------------------------------------
     * 
     * Outputs the given variable(s) with color formatting and location
     * 
     * UUSAGE: varDebug(array);
     *
     * @param    mixed    - variables to be output
     */
    
function varDebug()
    {
        list(
$callee) = debug_backtrace();

        
$arguments func_get_args();

        
$total_arguments func_num_args();

        echo 
'<div><fieldset style="background: #fefefe !important; border:1px red solid; padding:15px">';
        echo 
'<legend style="background:lightgrey; padding:5px;">'.$callee['file'].' @line: '.$callee['line'].'</legend><pre><code>';

        
$i 0;
        foreach (
$arguments as $argument)
        {
            echo 
'<strong>Debug #'.++$i.' of '.$total_arguments.'</strong>: '.'<br>';
            
var_dump($argument);
        }

        echo 
"</code></pre></fieldset><div><br>";
        exit;
    }


Will make it easier to read in the forum's hers.
bro i don't understand how to use your function...

You just pass the array into it just like var_debug, place the method into a CodeIgniter helper file and autoload it,
then just call it like any other method varDebug(your_array or query);
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply


Messages In This Thread
Undefined valuable - by kayinja.denis - 05-09-2017, 12:54 AM
RE: Undefined valuable - by neuron - 05-09-2017, 01:07 AM
RE: Undefined valuable - by kayinja.denis - 05-11-2017, 06:29 AM
RE: Undefined valuable - by php_rocs - 05-09-2017, 08:13 AM
RE: Undefined valuable - by neuron - 05-10-2017, 02:41 AM
RE: Undefined valuable - by kayinja.denis - 05-10-2017, 03:30 AM
RE: Undefined valuable - by neuron - 05-11-2017, 06:48 AM
RE: Undefined valuable - by InsiteFX - 05-10-2017, 03:48 AM
RE: Undefined valuable - by kayinja.denis - 05-10-2017, 04:17 AM
RE: Undefined valuable - by mirivlad - 05-10-2017, 08:08 AM
RE: Undefined valuable - by InsiteFX - 05-10-2017, 12:06 PM
RE: Undefined valuable - by kayinja.denis - 05-11-2017, 04:28 AM
RE: Undefined valuable - by InsiteFX - 05-11-2017, 09:14 AM
RE: Undefined valuable - by xenomorph1030 - 05-11-2017, 08:17 AM
RE: Undefined valuable - by kayinja.denis - 05-11-2017, 10:21 PM



Theme © iAndrew 2016 - Forum software by © MyBB