duan051347 2017-01-13 16:34
浏览 50

Yii2-调试缺页

I am using Yii2 (basic), everything works like a charm except for one little problem, one page doesn't show debug panel, also this page doesn't appear in Yii2 debugger history. When i asked this question on yii official irc, i was told to update yii2-debug, so i did, i updated it from 2.0.0 to currently newest 2.0.7, but it did not really help me, i dont see any difference.

To be specific:

  • The page will load and show all the content with no errors, the only thing missing is the debug panel.

  • The debug panel works like a charm for all other pages (even in the same controller)

Could this behavior be caused by my code?

Or is it just problem on their (yii dev team) side and there is no way i could fix this at the moment?

EDIT: I tracked down and solved the problem. This bug was caused by following foreach loop in one of functions in my model.

foreach($SROut as $key => $in){
    $stockDetails = $stock->getStockDetailsByID($SROut[$key]['ID_Stock']);
    $SROut[$key]['Name'] = $stockDetails['Name'];
    $SROut[$key]['Units'] = $stockDetails['Units'];
}

But when i changed it to:

foreach($SROut as $key => $in){
    $stockDetails = $stock->getStockDetailsByID($key['ID_Stock']);
    $SROut[$key]['Name'] = $stockDetails['Name'];
    $SROut[$key]['Units'] = $stockDetails['Units'];
}

The debug panel showed up, but it broke my code, now the foreach loop is not working as it should, but this is something i can handle on my own.

To answer my own question:

Yes it was caused by my code.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥30 Unity接入微信SDK 无法开启摄像头
    • ¥20 有偿 写代码 要用特定的软件anaconda 里的jvpyter 用python3写
    • ¥20 cad图纸,chx-3六轴码垛机器人
    • ¥15 移动摄像头专网需要解vlan
    • ¥20 access多表提取相同字段数据并合并
    • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
    • ¥20 Java-Oj-桌布的计算
    • ¥15 powerbuilder中的datawindow数据整合到新的DataWindow
    • ¥20 有人知道这种图怎么画吗?
    • ¥15 pyqt6如何引用qrc文件加载里面的的资源