title: Using $this when not in object context in Yii
body: <p>Iam getting an error like <code>Fatal error: Using $this when not in object context in ..\controllers\ServiceRequestController.php on line 661</code> when calling a view file using controller action from EasyTabs extension.<br> Iam calling the controller action like this in the view file<br> <code>ServiceRequestController::actionTest();</code><br> and in controller<br></p>
  
  <pre><code>     public static function actionTest()  
     {
          $this-&gt;redirect('test');
      }
  </code></pre>
  
  <p>How can I get rid of this error?? When I googled, I found that <code>$this cannot be used in a static method.</code> . So I tried out using<br> <code>$model = new ServiceRequest();
             $model-&gt;Test();</code> in my view file.But it shows the error as <code>ServiceRequest and its behaviors do not have a method or closure named "actionTest".</code>
  Can anyone help me fixing the error? Thanks in advance
  I tried to fix using this link . But I think Iam mistaken. <a href="https://stackoverflow.com/questions/2350937/php-fatal-error-using-this-when-not-in-object-context">PHP Fatal error: Using $this when not in object context</a></p>