Symfony notes – building the Download Portal

Another useful tool we try to use is the MakerBundle. We start by making a Category editor.

$ bin/console make:crud Category

Then we have to adjust the URLs, add the fact that categories are always defined “by project”, and so on, by editing the Controller and the templates.

Update

Never use this. It forces you to:

  • have logic dispersed into files which are not required
  • have the same form for creating and editing, unless you disperse things even more with the “solution” outlined here

Use instead the “viable solution” criticised by the above article, how to use forms with data stored in array, so that you put the logic in the controller (where it should be, whatever the Symfony people say) and STOP.

 

Leave a Reply