0

i use sonata admin with symfony2.4. i have two entities exam and student with Many To Many relation , what i want is when i add a new exam, a new button created that shows me the list of student should participate in the exam. in configureField form i have these buttons: Create, Create and return to list, Create and add

when i click the button create to add a new exam, these are buttons created by sonata:

Update, Update and close, Delete. i want to add a new button 'students list' to these buttons, is it possible?

user3309231
  • 186
  • 3
  • 20
  • possible duplicate of [Add custom button to edit page of sonata admin bundle](http://stackoverflow.com/questions/11725476/add-custom-button-to-edit-page-of-sonata-admin-bundle) – M Khalid Junaid Mar 10 '14 at 13:24
  • Thanks, but i have not understand the code, what is id??? also i want that the liste of students be shown like default sonata show list(i do not want to create my own template). how to do it? – user3309231 Mar 10 '14 at 14:04
  • i tried the code but when i click on the created button i got this error message:The controller must return a response (Array(id => 14) given). i put my query in the controller function right? – user3309231 Mar 11 '14 at 08:29
  • You need to return a response (with template) not a result from a query... – Geert Wille Mar 11 '14 at 10:19
  • public function listeStudentAction($id) { return(array( 'id' => $id )); }this is the code i used. how to return the template that shows the result of my query? – user3309231 Mar 11 '14 at 10:29

0 Answers0