public function actionCreateOrderChild($id) { $model = new OrderItem(); $model->setAttribute('order_id', $id); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if (isset($_POST['OrderItem'])) { $model->attributes = $_POST['OrderItem']; if ($model->save()) { $this->redirect(array('view', 'id' => $model->id)); } } $this->render('create', array('model' => $model)); }