Prerequisite default global language to set to Chinese
Take the framework installation as an example:
For example, after logging in User->name;? > will display the default admin or demo,
But if you don't log in User->name;? > will show guest, how do I set this guest?
Ask for advice?
Reply to discussion (solution)
Guest is the guest's meaning, that is, unregistered users
You can find it in the login processing code
Class Cwebuser extends Capplicationcomponent implements iwebuser{public $guestName = ' Guest '; ...
There should be a webuser in the protected/components to inherit, to change his own
I do not know whether to use the native Yii, to give you a reference
Thank you, 2l code accurate positioning, but there is a problem, in the Cwebuser directly change is not very good ah? Can you give a thought to solve the idea?
Ask for advice?
If you don't think it's a good thing to change directly, create a class yourself, inherit Cwebuser, and make Yii::app ()->user the class you created for yourself. You can then modify the class you created yourself.
Well, it's basically a 4L approach.
Instead of defining a class, you can specify the property $guestname=xx when you set the user directly at the configuration file, and all properties are redefined in the configuration file. The program is instantiated according to your configuration
Thank you, two ways to try