I am working on the basic template of Yii2. I have got a jQuery script
public $jsOptions = array(
'position' => \yii\web\View::POS_HEAD
SyntaxError: expected expression, got '<'
registerJsFile() needs an url, you should simply publish (make it web accessible) your file before registering it, e.g. :
$pub = Yii::$app->assetManager->publish(__DIR__ . '/create.js'); $this->registerJsFile($pub, ['depends' => ['yii\web\JqueryAsset']]);
Or you could create an asset bundle and registering it in your view.