我們使用:yiidebugtb來調試(因為用他界面比較美觀,不影響界面其他元素)。
1.下載yiidebugtb,并且放入到application.extensions.yiidebugtb 目錄
2.修改main.php,加入如下代碼:
'log'=>array( 'class'=>'CLogRouter', 'routes'=>array( array( 'class'=>'CFileLogRoute', 'levels'=>'error, warning,trace', ), // 以下是新加 array( // configuration for the toolbar 'class'=>'XWebDebugRouter', 'config'=>'alignLeft, opaque, runInDebug, fixedPos, collapsed, yamlStyle', 'levels'=>'error, warning, trace, PRofile, info', //'categories' => 'system.db.*', 'allowed3.db鏈接的配置里面做下修改:
'db'=>array( 'connectionString'=>'MySQL:host=*.*.*.*;dbname=test', 'emulatePrepare'=>true, // 加入 'enableParamLogging' => true, // 加入 'username'=>'-----', 'passWord'=>'---', 'charset'=>'utf8', 'schemaCachingDuration'=>'0', 'autoConnect'=>false, ),4.完成
如:
新聞熱點
疑難解答