Yii framework Many to Many relationships
问题 What is the method to save and update Many to Many relationship in Yii framework? 回答1: There is a better implementation as behavior. http://www.yiiframework.com/forum/index.php?/topic/6905-please-test-my-ar-enhancement-automatically-sync-many-many-table-when-calling-save/ 回答2: Unless you create a model for the table between the two main tables, your only option is to use DAO (Database Access Object) and specify SQLs with it. Have a look at how blog demo accomplishes this task. 回答3: use MANY