Home > Article > Backend Development > Yii framework outputs and executes sql statements on the page to facilitate debugging, yiisql_PHP tutorial
The example in this article describes how the Yii framework outputs and executes sql statements on the page to facilitate debugging. Share it with everyone for your reference. The specific analysis is as follows:
We use: yiidebugtb for debugging (because the interface is more beautiful and does not affect other elements of the interface).
1. Download yiidebugtb and put it into the application.extensions.yiidebugtb directory
2. Modify main.php and add the following code:
// The following is newly added
array( // configuration for the toolbar
'class'=>'XWebDebugRouter',
'config'=>'alignLeft, opaque, runInDebug, fixedPos, collapsed, yamlStyle',
'levels'=>'error, warning, trace, profile, info',
//'categories' => 'system.db.*',
'allowedIPs'=>array('127.0.0.1','::1','192.168.1[0-5].[0-9]{3}','If the program needs to fill in your Public network ip'),
),
),
)
Make the following changes in the configuration of 3.db link:
4. The operation effect is shown in the figure below:
I hope this article will be helpful to everyone’s PHP programming based on the Yii framework.