Cannot use yii\base\Object as Object because 'Object' is a special class name yii2 advance

拥有回忆 提交于 2019-12-10 19:12:42

问题


I just bougth a stronger pc, installed composer and wanted to continue my project on it but when I use gii it give me this error. How can I fix it ? Why am I getting it ? Thank you.


回答1:


solved. since 2.0.13, the class name Object is invalid since PHP 7.2, use [[BaseObject]] instead. So in the vendor/yiisoft/yii2-gii/CodeFile.php just had to change Object to BaseObject.




回答2:


solved. since 2.0.13, the class name Object is invalid in PHP 7.2,

//Replace //class User extends \yii\base\Object implements \yii\web\IdentityInterface

class User extends \yii\base\BaseObject implements \yii\web\IdentityInterface

And Download the yii-basic-app-2.0.25 from https://www.yiiframework.com/download after that copy the yiisoft folder from vendor and replace the yiisoft folder in your project in vendor folder

Now check your project will be working fine. Its work for me hope it will work for you.



来源:https://stackoverflow.com/questions/50269306/cannot-use-yii-base-object-as-object-because-object-is-a-special-class-name-yi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!