How to display a message in the browser console browser log when using YII2?

  • so to you in a log or in the console? - korytoff
  • in the console log (in the console) - user197889
  • What does echo not suit you? - korytoff
  • echo - displays on the page and not in the console. - user197889
  • one
    Ohhhh, in the question after all, so the сообщение в лог консоли YII2? was written сообщение в лог консоли YII2? - korytoff

1 answer 1

After finding out the details in the chat, I realized that the question about debugging php code is in principle. So in order:

The first thing I always use for live debugging is outputting a variable to the browser:

 echo '<pre>'; echo var_dump($data); die('</pre>'); 

Secondly, almost all frameworks have their own debugging panel, Yii2 has Debugger Toolbar + article how to configure .

Then there are more advanced options through xdebug and IDE .

Further profiling (logging and analytics) via Yii :: Logger or completely cool through Graylog .