public function actionCreate() { $model = new GroupModel(); if (isset($_POST['GroupModel'])) { // 收集用户输入的数据 $model->attributes = $_POST['GroupModel']; if ($model->validate()) { $model->save(); $this->redirect(array('index')); } } $this->render('create', array('model' => $model)); }