yii怎么这么难啃撒,求。。。

个人问题,感觉yii好难上手,看完blog,还有这位仁兄biner的CMS(感谢这位仁兄),

第六还是第七页(第一次发帖,不给发链接 - -||)

能看懂,还是一知半解的~~~

各位前辈,有什么好的方法快速上手进行开发的,已经默默捣鼓了2~3个星期了

=========

还有个问题请教, biner仁兄例子里,

yiicms/content/life

yiicms/content/honor

代码:

public function actionHonor() {


	$this->cate_id = 12;


    $content=content::model()->getContent($_GET['id'],$this->cate_id);


	$this->render('content',array('content'=>$content));


}	





public function actionLife() {


	$this->cate_id = 14;


    $content=content::model()->getContent($_GET['id'],$this->cate_id);


	$this->render('content',array('content'=>$content));


}

代码都一样的,怎么 /content/life 就出现这样的错误呢

服务器内部错误

CDbCommand 无法执行 SQL 语句: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘ORDER BY sort desc’ at line 1

===========

怎么开启显示执行的sql语句?貌似TP那样在底部显示sql语句还有效率~~什么的

----ORZ----

在protected/main.php里配置一下就行了。


'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',      //加上这句就可以查看SQL了。

		),

		

	),

),

3q ls

继续努力~~

http://www.yiiframework.com/doc/guide/1.1/en/index

先把这里的东西看完

我认为,你出SQL错误的原因,应该是$_GET[‘id’]这个东西没有进行非空判断导致的

原来湿湿同学也有在这个版块发言啊。

多看源码,多练习,中文类的资料少看,人个之见