I want to build a form that can use the information stored in a session to set default field values. ie when a user wants to log in, the field username will be populated automatically with the username stored in the session.
Asked
Active
Viewed 276 times
1 Answers
1
What you probably need to do is Create a Custom Form Field Type or even use a Transformer in a custom field type.
I'm not super familiar with all Symfony2 features, but I assume you could pass a session or a response object (to get a cookie) to the transformer. If the username is available it can be set as the field data, if is not set an empty string.