On 08.03.2011, at 18:25, Thomas Rabaix wrote: >>> While reviewing the code I noticed that there is a lot of code in the >>> Controllers that we could maybe move to helpers. This is imho especially >>> important as right now there is a lot of "format" specific code, that >>> people might want to handle differently. For example I would like to use >>> the ViewBundle [2]. Others might want to intentionally not support json or >>> might prefer to use twig templates for json etc. > Yes for now the CrudController is "html" centric. Recently I move the > configuration into the DIC so you can use any kind of controller you want. So > you are free to do anything you want. Extending the CrudController is not > mandatory (but this code in the configure method is ... ). [1]
yes .. but i think there should be much less methods in the Controller. for example methods like getBreadcrumbs() shouldnt be in the Controller. also a lot of functionality in updateAction() could maybe be moved to the form and batchActionDelete() to a repository helper. well there is also the CoreController: https://github.com/sonata-project/AdminBundle/blob/master/Controller/CoreController.php >>> So I think in general its a good idea to make the Controllers as slim as >>> possible, by moving as form logic to the form classes, maybe adding a few >>> helper services etc. Do you agree? This way its easier to get an overview >>> when inheriting or its more realistic to re-implement Controllers from >>> scratch. > Can you give more details about this ? well obviously i wouldnt need stuff like the follow with the viewbundle: https://github.com/sonata-project/AdminBundle/blob/master/Controller/CRUDController.php#L39 > However the current experimental Form Framework will duplicate this work, > once Bernhard's work will be merged into the trunk. The form builder will > change a lot. The current methods will become services, and the form builder > will be a glue between specific codes required by the AdminBundle and the > Form field services. ok .. i guess i will have to wait for Bernhard to get his branch in then and for you to update the AdminBundle. regards, Lukas Kahwe Smith [email protected] -- If you want to report a vulnerability issue on symfony, please send it to security at symfony-project.com You received this message because you are subscribed to the Google Groups "symfony developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/symfony-devs?hl=en
