سؤال

I'm currently porting an app to Symfony2, and I'm doing a lot of repetitive work. I'm generating the controllers for all the routes, and they all look alike (minor differences here and there). They are nothing like the default controller symfony generates with doctrine:generate:crud, though.

I was wondering if I could just change the way symfony generates those controllers, instead of writing my own controller generation command.

There's nothing on the documentation, nor could I find it on Google.

هل كانت مفيدة؟

المحلول

You could try to override default controller skeleton templates. They are located in vendor/sensio/generator-bundle/Sensio/Bundle/GeneratorBundle/Resources/skeleton/controller

Here is how to override them - http://symfony.com/doc/current/bundles/SensioGeneratorBundle/index.html#overriding-skeleton-templates

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top