Jump to content

debugging with firePhp


si3sta

Recommended Posts

Hello,

 

Does anybody know how to debug with firePhp (or any other way) when programing a module?

 

I can create a simple array and then i can make it show on firebug console but I can´t get the values from vars and array in the functions of the classes

 

thanks!

Link to comment
Share on other sites

Hi

I made a test.php file in root directory and it works for me,

require_once(dirname(__FILE__).'/config/config.inc.php');
require_once(dirname(__FILE__).'/override/classes/FirePHP.class.php');
ob_start();
$firephp = FirePHP::getInstance(true);

$var = array('i'=>10, 'j'=>20);

$firephp->log($var, 'Iterators')

The autoload will not work, then you have to add the require_once.

 

Good dev

  • Like 1
Link to comment
Share on other sites

I create test.php and im calling the function from my module and is ok, i can read $var from test.php from my module, but still can read what is in a var inside a function.

 

Im creating a new module from blockcategories, so there is the class blockcategories.php i want to read what is in "id_parent" witch is in "hookLeftColumn" function. Do you know how can i get it?

Link to comment
Share on other sites

thanks for answering

But still, can´t see it on the console, it shows just an empty space, im not sure what im doing wrong (provably many things, is my first prestashop, first PHP and first smarty)

 

I found a solution though

Im creating a test var on the PHP that contents the array i want to test

 

$smarty->assign('ARRAYprueba', $resultIds);

 

and then on the smarty i read it with this code:

 

 

<div id="pruebas">
       <ul>
       {$firephp}
       {foreach from=$ARRAYprueba name=miNombre item=elemento}
        -------------------------<br/>
           {foreach from=$elemento key=key item=item}
               id: {$key}: {$item}<br/>
           {/foreach}
       {/foreach}
       </ul>  
   </div>

Edited by si3sta (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...