On 16 Dec 2008, at 11:34, François CONSTANT wrote: > I would like to get a user attribute in view.yml (in order to modify > the title). > > I know that I can use some php in this file but what I don't know is > how to access the sf_user object. Within an action I could use $this- >> getUser() and set up a new config variable but I'm sure there is a > way to access this user object in the view.yml.
I think you'll need to get the context first (I'm talking about 1.0 here, it's the only version I use): $context = sfContext::getInstance(); $user = $context->getUser(); This should work I think but I've not tested it. Alexander --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---
