在我的模型类的自定义验证函数中。我需要使用javascript代码。为此,我使用了registerJs函数,但我得到了错误:-调用未定义的函数registerJs()Non-staticmethod yii\web\View::registerJs() should not be called statically, assuming $this from incompatiblecontext
如何在Yii2
在Yii2中,我尝试添加动态css loading.So,我在web/css/custom.php.php中添加了php文件,现在我无法在custom.php中访问模型或会话。它显示了一些错误。现在我添加了会话的概念,但是显示了这个错误,Fatal error: Class 'Yii' not found.layout文件我提到了自定义文件链接。php echo Yii::$app->request->baseUrl?