What is the best way to register js code in yii2 view?
registerJs( \'$(\"document\").ready(function(){ alert(\"hi\"); });\
I prefer use richardfan's widget:
use richardfan\widget\JSRegister; static::POS_BEGIN]); ?>