title: Yii2: REST API actions in ActiveController
body: <p>In docs guides there is example:</p>
  
  <pre><code>    namespace app\controllers;
  
      use yii\rest\ActiveController;
  
      class UserController extends ActiveController
      {
          public $modelClass = 'app\models\User';
  }
  </code></pre>
  
  <p>But i dont get it, how to work with actions.</p>
  
  <p>For example: </p>
  
  <ul>
  <li><p><strong>DataBase</strong> has tables with many-to-many relationship (via Junction table). </p></li>
  <li><p><strong>Сomponent</strong> to work with the models and the formation of a common response from multiple tables according to the transmitted data. Can return an array, or an array of objects.</p></li>
  </ul>
  
  <p>When use it in commands controller, it was like:</p>
  
  <pre><code>    class LastTweetsController extends Controller
      {
          /**
           * @param int $count
           *
           * @throws yii\base\InvalidConfigException
           */
          public function actionIndex($count = 10)
          {
              /** @var TweetLastfinder $tweetLastFinder */
              $tweetLastFinder = Yii::$app-&gt;get('tweetlastfinder');
  
              /**
               * @var TweetShow $tweetShow
               */
              $tweetShow = Yii::$app-&gt;get('tweetshow');
  
              // For show tweets into terminal:
  $tweetShow-&gt;showLastTweetsJSON($tweetLastFinder-&gt;findLastTweets($count));
          }
      }
  </code></pre>
  
  <p>But how i can make same operation in ActiveController (Transmit parameter $count and return result in JSON)?</p>