tag:blogger.com,1999:blog-5257555736106762701.post2814596425976961386..comments2024-02-15T05:46:49.798-08:00Comments on Learn Yii: YII » On Many Many RelationshipsNeil McGuiganhttp://www.blogger.com/profile/14122981831780837323noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-5257555736106762701.post-79202690347651349182014-01-21T08:24:37.412-08:002014-01-21T08:24:37.412-08:00I am struggling to do this from yesterday. You hav...I am struggling to do this from yesterday. You have saved my time. Great job and thanks alot.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5257555736106762701.post-67659740558903585602011-08-09T21:35:19.440-07:002011-08-09T21:35:19.440-07:00Just set the $id param of actionDelete to expect t...Just set the $id param of actionDelete to expect the pk array (or alternatively add a 2nd param to represent $posting_id, removes some needless code).<br /><br />My recommendation:<br /><br />// $_GET looks like<br />// $_GET = array('posting_id'=>1234,'tag_id'=>1234);<br />// So in your delete link, you would pass 'id'=>$model->getPrimaryKey()<br /><br />public function actionDelete(array $id)<br />{<br /> PostingTag::model()->deleteByPk($id);<br />}Jon Lhttps://www.blogger.com/profile/10169734774290652639noreply@blogger.comtag:blogger.com,1999:blog-5257555736106762701.post-54995795776412298582011-08-04T05:06:08.105-07:002011-08-04T05:06:08.105-07:00This is GOLD! So many Yii users run into problems ...This is GOLD! So many Yii users run into problems when it comes to MANY_MANY relationships. THANK YOU SO MUCH for shedding some light on the issue!!!Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5257555736106762701.post-91446339365653588962011-02-08T19:24:19.267-08:002011-02-08T19:24:19.267-08:00Thank you Neil!Thank you Neil!Anonymousnoreply@blogger.com