Hi, in sfGuardSecurityUser the function to get the sfGuardUser object is getGuardUser()
so : if($this->getUser()->isAuthenticated()){ $this->getUser()->getGuardUser()->getId() } On Nov 27, 4:01 am, Rodrigo <rsantel...@gmail.com> wrote: > Hi, I'm using the sfguard plugin in my application. > My problem is that after I login when I do this on the action > > $id = null; > if($this->getUser()->isAuthenticated()){ > $this->getUser()->getsfGuardUser()->getId() > > } > > the following error appears > > Call to undefined method myUser::getsfGuardUser. > > I start checking what could be my mistake so I check myUser.class.php: > it looks like > > class myUser extends sfGuardSecurityUser > { > > } > > I put the followin code on the template: > > <?php if($sf_user->isAuthenticated()): ?> > <?php print_r($sf_user->getGuardUser());?> > <?php endif; ?> > > And it prints the user that I'm log on. > > But when I do: > > if ($this->getUser ()->isAuthenticated ()) { > print_r($this->getUser ()); > > } > > It doesn't print the sfGuardUser. > > What I'm doing wrong? Should I put something extra? -- You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-us...@googlegroups.com. To unsubscribe from this group, send email to symfony-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.