php - How to structure correctly a Symfony2 controller - deal with huge classes -
i have existing php project have move on symfony. working symfony 6 month , found nice use.
hovewer, have question:
in old code, have big classes of 6000 each :| now, in new project, have controller should done (including 2 or 3 classes of 6000 lines).
what best practcice symfony, creating bundle per huge class , call functions of 2 or 3 bundles in controller, or else?
read on symfony more , answers may fall place, services http://symfony.com/doc/current/book/service_container.html
edit
look @ code , divide logically. have no idea controller does, valid 1 class - unlikely. @ class , make decisions how best split up.
do diagram or on paper first! doing in code first takes much longer , harder fix when inevitably make mistake first time around.
Comments
Post a Comment