title: controller action for changing status in yii2
body: <p>I tried to create a actionSuspend in my userController.
  But when i click the button to update the status its redirect me to a blank page or the function i created is not working.
  This is my Controller code:</p>
  
  <pre><code>public function actionSuspend()
      {
          $user_model = \app\models\User::find()
                      -&gt;where(['social_worker'=&gt;'1'])
                      -&gt;one();
          if($user_model == 'suspend'){
              $user_model-&gt;social_worker = 'activate';
             return $this-&gt;redirect(['index']);
  
          }
      }
  </code></pre>
  
  <p>and my view code is</p>
  
  <pre><code>'suspend' =&gt; function($url,$model){
      if($model-&gt;social_worker ==1)
          return Html::a('&lt;span class="btn btn-xs btn-danger icon-remove bigger-80"style="margin-left:5px;"&gt;&lt;/span&gt;', $url,['title'=&gt;Yii::t('app','Revoke social worker')]);
      },
  </code></pre>