0

I'm new with sonata and symfony2 and I'm facing some difficulties. I have two entities : project and prototype (one project can have many prototypes). everything is ok : I can edit, create, list and delete a project. But I want to customize the show action in my project controller so I can list the prototypes that belong to the project. So first what is the best way to do this ?

  • As the linked post above shows you can use Bundle Inheritance in Symfony2 to override parts of a vendor bundle, including controllers, templates etc. Very useful! – Darragh Enright Jul 29 '15 at 11:07
  • I created a new show template that inherit from the original one ! But the problem for me is the controller ! should I create a new one or modify the function configureShowFields ? – Lightning M Jul 29 '15 at 11:14
  • I cannot be more specific unfortunately but you should be able to create a new controller with the same name in your bundle, extending from the Sonata controller you want to override. All you have to do then is override `configureShowFields` and make the modifications to your requirements. – Darragh Enright Jul 29 '15 at 11:21
  • I will try this thank you – Lightning M Jul 29 '15 at 13:10

0 Answers0