title: Calling action from another controller and returning data Yii2
body: <p>I have controller where I need to access an action from another controller and return data:</p>
  
  <p><code>rest/controllers/AController</code></p>
  
  <pre><code>switch (@$_GET['barcodeType']) 
  {
      case '1D':
      {  
              //do action Request1 from BController and return data from 
              this controller
      }
      break;
  
      case '2D':
      {
              //do action Request2 from BController and return data from 
              this controller
      }
      break;
  
      default:
      return  ['Wrong barcodeType'];
      break; 
  }
  </code></pre>
  
  <p><code>soap/controllers/BController</code></p>
  
  <pre><code>public actionRequest1{
      //do something and return data to AController
  }
  
  public actionRequest2{
      //do something and return data to AController
  }
  </code></pre>
  
  <p>How can I do this?</p>