I have been defining all my forms as services, which seems like good
practice, but have just
ran into what seems to be a dead-end when trying to populate a choice
field from a value in the controller.

For example, to list all of the pages on a specific Site in a
ChoiceField I need to provide the form with the Site object
which has been retrieved in the Controller. But as the form is
instantiated by the DIC I cannot inject the (late)
dependency, and I cannot set it after instantiation because the Form
Framework doesnt allow it...

So ... with this limitation in mind, generally, should forms be
provided as Services, if so do we need to modify the
form object to enable dependencies to be set after instantiation?



-- 
Dan Leech

Web Developer
www.dantleech.com

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony developers" 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-devs?hl=en

Reply via email to