public function actionCreate() { $model = new RestUser(); if ($this->isPost() && ($data = $_POST)) { $model->attributes = $data; if ($model->save()) { $this->redirect(array('view', 'id' => $model), true, 201); } } $this->render('empty', array('model' => $model)); }
public static function newInstance() { if (!self::$instance instanceof self) { self::$instance = new self(); } return self::$instance; }