2011-04-07 15:16:36 0 评论 Yii 1.0 Boy.Lee

Yii 1.0 在页面底部显示SQL语句

{config/main.php}

'db'=>array(
			'connectionString' => 'mysql:host=localhost;dbname=test_try',
			'emulatePrepare' => true,
			'username' => 'boy_test',
			'password' => 'password',
			'charset' => 'utf8',
			'enableProfiling'=>YII_DEBUG,
			'enableParamLogging'=>YII_DEBUG,
		),

'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
				// uncomment the following to show log messages on web pages

				array(
					'class'=>'CWebLogRoute',
				  'levels'=>'trace',
        	'categories'=>'system.db.*',
				),

			),
		),