So... your site needs an admin area. Do yourself a favor and skip all that custom code and jump straight into EasyAdmin bundle. Why #1? Because it'll take you a fraction of the time to build what you need. Why #2? Because it'll be even better than what you would build by hand, including built-in widgets for auto-completion and toggling boolean fields. It's... pretty sweet.
In this tutorial, we'll learn how to admin interfaces that are highly customized:
So let's do a little bit of work for a lotta bit results (note: "lotta bit" is a term I just made up).