I am building a web application using Symfony 1.4 and Doctrine for a school and I want to make a very simple form to add a course to a student.
The main problem I have is that in the drop down list I only want to show the courses in which the student is currently not enrolled.
I already have a function in the model (in Student.class.php) which returns all the courses in which the student is not enrolled but the problem is I don't know how to pass the student to the configure() of the form. I have tried several options like passing it with the constructor of the form to a global variable or a special set method but none of them have worked.
Is there any form to pass the student to the configure() method?
Thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…