yii怎么顯示調(diào)試信息

YII顯示調(diào)試信息的方法:首先在入口文件中添加“defined(‘YII_DEBUG’) or define(‘YII_DEBUG’,true);”;然后開啟頁面顯示模式;最后進(jìn)行數(shù)據(jù)庫配置即可。

yii怎么顯示調(diào)試信息

yii 顯示調(diào)試信息及數(shù)據(jù)庫配置

在程序測試中我們需查查看程序運(yùn)行過程,sql執(zhí)行語句等,這時(shí)候我們可以開啟YII的調(diào)試模式

推薦:《yii教程

開啟方法

1、入口文件添加

defined('YII_DEBUG')?or?define('YII_DEBUG',true);

2、配置文件中增加

'log'=>array( ??????'class'=>'CLogRouter', ??????'routes'=>array( ????array( 'class'=>'CWebLogRoute',?//開啟頁面顯示模式 ???????????), ?????), ),

3、數(shù)據(jù)庫配置

'db'=>array( 'connectionString'?=>?'mysql:host=localhost;dbname=yiidemo',//字符串連接 'username'?=>?'root',//數(shù)據(jù)庫用戶名 'password'?=>?'',//數(shù)據(jù)庫密碼 'charset'?=>?'utf8',//數(shù)據(jù)庫編碼 'tablePrefix'=>'yii_'//數(shù)據(jù)庫前綴 ),

? 版權(quán)聲明
THE END
喜歡就支持一下吧
點(diǎn)贊6 分享