How can I see CakePHP's SQL dump in the controller?

后端 未结 8 1276
余生分开走
余生分开走 2020-12-04 06:04

Is there a way that one can cause CakePHP to dump its SQL log on demand? I\'d like to execute code up until a point in my controller and see what SQL has been run.

8条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-04 06:38

    What worked finally for me and also compatible with 2.0 is to add in my layout (or in model)

    element('sql_dump');?>
    

    It is also depending on debug variable setted into Config/core.php

提交回复
热议问题