Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9126667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:05:38+00:00 2026-06-17T07:05:38+00:00

I tried public function getName() { return ‘TEST’; } in UserIdentity.php but it doesn’t

  • 0

I tried

public function getName()
{
    return 'TEST';
}

in UserIdentity.php but it doesn’t seem to change the value of Yii::app()->user->name

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T07:05:39+00:00Added an answer on June 17, 2026 at 7:05 am

    In the class UserIdentity that you defined you’ll need to set a new state by using setState(name, value) method.

    For example in the method authenticate if the user is good:

    //if the user is good (good login and good password)
    $this->_id=$record->id;
    $this->setState('name', $record->name);
    $this->errorCode=self::ERROR_NONE;
    

    Then you will be able to call Yii::app()->user->name

    • A complete example in the Yii guide
    • The setState() documentation
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Flex: public function callFromJavaScript():String { test.label='dfdsfsdf'; return "1"; } public function init():void { ExternalInterface.addCallback("sendToFlash",
In magento1.7, I have tried something like below in my custom controller. public function
I am querying an xml file with php like this : public function trackOrderAction()
I want to test a function with this header: public function includeNumComments($posts){ Where $post
Controller First I tried this: [HttpPost] public ActionResult Edit(JournalEntry journalentry) { if (ModelState.IsValid) {
I tried to extend Socket object something as... public class TestSocket extends Socket {
I've tried to add the following class to my app: public class AlertDialogHelper {
I tried some variants, one of them: tv.addTextChangedListener(new TextWatcher() { @Override public void beforeTextChanged(CharSequence
I tried writing this class #include <memory> class ContainerUnique { public: ContainerUnique(void); ~ContainerUnique(void); private:
I've tried to extend the RequiredAttribute to make some localizations. I wrote this: public

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.