title: how to call JavaScript from controllers in yii2
body: <p>in my research I found that one can use this method:</p>
  
  <pre><code>$this-&gt;registerJsFile()
  </code></pre>
  
  <p>However, when I use it I get this error:</p>
  
  <blockquote>
    <p>Calling unknown method:
    frontend\controllers\AvailableController::registerJs()</p>
  </blockquote>