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

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -