[Flow] Re: Login show Username

Stephen Bungert stephenbungert at yahoo.de
Wed Jan 7 16:45:24 CET 2015


I do this:

		 $this->account = $this->securityContext->getAccount(); // Flow user account
			// Get my own connected user object for account
		if ($this->account != NULL) {
			$this->user = $this->userRepository->findByAccount($this->gbAccount);
		}


Then I can assign them both to my view like you did

$this->view->assign('username', $account);

You won't be able output the username object as is in fluid (except with debug).

You need to access the objects properties

{account.username} or whatever the property is you want access to.

Or just change your call to assign

$this->view->assign('username', $account->getUsername());

I do all this in a shared base controller that then assigns the user and account objects to all views.


More information about the Flow mailing list