Open m132418 opened 7 years ago
Can you provide more information? What version you install. Full stack trace or any additional information?
yii-advanced-app-2.0.12 user model :frontend/models/User.php implements a method public static function getUserName(){
if (Yii::$app->user->isGuest)
return "Guest" ;
else
{
$data = static::findOne(['id'=>Yii::$app->user->identity->getId(), 'status' => self::STATUS_ACTIVE]) ;
return $data['username'];
}
}
url :http://frontend.all1.dev/qa/default/view?id=1&alias=
PHP Compile Error – yii\base\ErrorException
Cannot declare class frontend\models\User, because the name is already in use
in G:\sites\2017-9\all1\frontend\models\User.php at line 23 14151617181920212223242526272829303132 * @property string $password_hash
/**
nginx/1.11.5 Yii Framework/2.0.12
do you have wechat or QQ?
my config is 'modules' => [ 'qa' => [ 'class' => 'artkost\qa\Module', 'userNameFormatter' => 'getUserName' ], ],
error report as title.
error raised in this $answerDataProvider->models [vendor/artkost/yii2-qa/views/default/view.php]