Custom panel for debug extension

The Yii2-debug extension is a powerful tool for debugging own code, analyzing request information or database queries, and so on. Therefore, you can add your own panel for any custom report.

Getting ready

Create a new yii2-app-basic application by using the Composer package manager as described in the official guide at http://www.yiiframework.com/doc-2.0/guidestart-installation.html.

How to do it...

  1. Create the panels directory on the root path of your site.
  2. Add a new UserPanel class:
    <?php namespace app\panels; use yii\debug\Panel; use Yii; class UserPanel extends Panel { public function getName() { return 'User'; } public function getSummary() { return Yii::$app->view->render('@app/panels/views/summary', ['panel' => ...

Get Yii2 Application Development Cookbook - Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.