si3sta Posted July 18, 2012 Share Posted July 18, 2012 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 More sharing options...
math_php Posted July 19, 2012 Share Posted July 19, 2012 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 1 Link to comment Share on other sites More sharing options...
si3sta Posted July 19, 2012 Author Share Posted July 19, 2012 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 More sharing options...
math_php Posted July 19, 2012 Share Posted July 19, 2012 id_parent are in an array and it must be $resultParents and you can also find it in $result. Not sure that will help you. Link to comment Share on other sites More sharing options...
si3sta Posted July 19, 2012 Author Share Posted July 19, 2012 (edited) 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 July 19, 2012 by si3sta (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now