yii中有没有类似kohana的profiler功能?

可以在页面中打印出执行了哪些sql语句,另外还可以显示session和cookie等数据,方便调试

kohana中profiler功能的文档:http://docs.kohanaphp.com/libraries/profiler

你可以使用Yii的log功能:http://www.yiiframework.com/doc/guide/topics.logging

它可以把logging结果显示在网页上,文件里,数据库里,或js console里。

logging的内容包括SQL语句和performance profiling。

目前没有session, cookie的显示。不过这个功能很容易实现。你可以创建一个google ticket。http://code.google.com/p/yii/issues/entry

谢谢回答,问题已解决

在application的main config中加入以下代码粗体的部分即可

'log'=>array(

		'class'=>'CLogRouter',


		'routes'=>array(


			array(


				'class'=>'CFileLogRoute',


				'levels'=>'error, warning',


			),

                array(

                    'class'=>'CWebLogRoute',

                    'levels'=>'trace',

                ),

                array(

                    'class'=>'CProfileLogRoute',

                    'report'=>'summary',

                    'levels'=>'profile',

                ),

		),


	),