Answers.Body: <p>In viewController you can simply access your method like this:</p>
  <pre><code>public function actionDetails(){        
      $data = DefaultController::statistics();            
      return $data;
  }
  </code></pre>
  <p>I hope this will help.</p>
  <p>Thanks.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-08-31T14:27:39.513Z
Answers.LastActivityDate: 2021-08-31T14:27:39.513Z
Answers.UserDisplayName: ZealousWeb
Body: <p>As I have a method name statistics() in my defaultController and I have to use the same method in viewController is there any way to do so?</p>
  
Tags: <craft3><plugin-development>
Title: I am working on a plugin and I have to use a method of one controller in another controller's method?
ThreadText: # I am working on a plugin and I have to use a method of one controller in another controller's method?
  
  (Asked by: username_0 on 2021-08-31)
  
  As I have a method name statistics() in my defaultController and I have to use the same method in viewController is there any way to do so?
  
  **Tags:** craft3, plugin-development
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2021-08-31. Score: 1 | Accepted answer
  
  In viewController you can simply access your method like this:
  
  ```
  public function actionDetails(){        
      $data = DefaultController::statistics();            
      return $data;
  }
  
  ```
  
  I hope this will help.
  
  Thanks.
  
  
  ---
  
  