2013-10-03 18 views
0

我想從使用firephp和firebug.a的ajax調用中顯示一些信息,當ajax調用完成時我能夠顯示someinfo。在執行時有沒有辦法顯示?例如我的代碼在一個foreach循環內的id下面。如何使用Firephp在Firebug中顯示信息

foreach ($this->PreQualcalls as $value) {  
ob_start(); 
if(isset($array ['env:Envelope'] ['env:Body']['n1:preQualResponse1207'])){ 
       $this->setKeyNamePreQualResponse("n1:preQualResponse1207"); 
       $this->setKeyNameServiceProducts("n1:ServiceProduct1207"); 
       $this->setKeyNameModemProducts("n1:ModemProduct1207"); 
       $this->firephp->log("entered the 1207 call"); 
      }else{ 
       $this->setKeyNamePreQualResponse("n1:preQual1308Response"); 
       $this->setKeyNameServiceProducts("n1:ServiceProduct1308"); 
       $this->setKeyNameModemProducts("n1:ModemProduct1308"); 
       $this->firephp->log("entered the 1308 call"); 
      } 
ob_flush(); 
$this->firephp->log($this->getKeyNamePreQualResponse(),"Response type"); 
} 

我希望能夠在控制檯中顯示getKeyNamePreQualResponse(),因爲它正在經歷循環。

可能嗎?

謝謝。

回答

1

FirePHP設計用於在PHP腳本執行時收集日誌信息,然後將它與頁面響應一起發送到特殊標題中。它不會在Firebug中實時顯示日誌記錄調用。

要使用日誌記錄調試您的代碼,請將更多日誌記錄調用放入循環中。例如

$this->firephp->log("value", $value); 

你有一個循環,分配一個新的價值$value在每次迭代,但在任何的循環中的語句中不使用它。這看起來不正確。

如果您需要實時調試,我建議使用xDebug或其他實時記錄工具。

相關問題