/**
  * Creates a new Users model.
  * If creation is successful, the browser will be redirected to the 'view' page.
  * @return mixed
  */
 public function actionCreate()
 {
     $model = new Users();
     if ($model->load(Yii::$app->request->post()) && $model->save()) {
         return $this->redirect(['view', 'id' => $model->id]);
     } else {
         return $this->render('create', [
             'model' => $model,
         ]);
     }
 }
    private function SaveUser(){
        $user = new Users();
        $user->setAttributes($this->getAttributes());
        $user->setPassword($this->password);
        $user->user_role=DatabaseHelper::COMPANY_ADMIN;
        $user->is_active=DatabaseHelper::IN_ACTIVE;

        $user->profile_pic = $this->image;

        Auction::info('User Info Saved');
        return $user->save(false) ? $user->id : false;
    }