One of the features i want to include is that each user can be a supporter of N projects (also each project can be supported by N users) such as in change.org
For example i have table user (uid, uname) and tbl project (pid, pname) as well as tbl user_project (id, uid (foreign key), pid (foreign key))
How do i add a ‘support project’ button to each project when i list all the projects as a user?
And when i click the button, tbl user_project will be populated with a serial id, my uid, and the pid of the project.
Sorry if im asking too much and cannot still provide more info
public function actionYouraction() //specify action what you have mentioned in the url
{
$model=new clasaName;
if(isset($_POST['clasaName']))
{
$model->attributes=$_POST['clasaName'];
if(!empty($_GET)){
// here I am setting values of attributes from url, change as per your needs
$model->setAttribute("column_name",Yii::app()->request->getParam('type')); //set attribute values
$model->setAttribute("column_name",Yii::app()->request->getParam('id')); //set attribute values
}
if($model->save()){
$this->redirect(array('view','id'=>$model->intId));
}
}
$this->render('view_for_redirection',array(
'model'=>$model,
));
}