सही app/AppKernel.php
उदा .:
// app/AppKernel.php
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
//.....
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
$bundles[] = new Namespace\YourBundle();
}
// Or outside if, should you want your bundle to be available in production environment
$bundles[] = new Namespace\YourBundle();
में SensioGeneratorBundle
के बाद फिर YourBundle.php
ओवरराइड registerCommands
विधि में अपने बंडल रजिस्टर,
// Bundle\YourBundle.php
// other declarations
use Symfony\Component\Console\Application;
use Sensio\Bundle\GeneratorBundle\Generator\DoctrineCrudGenerator;
use Symfony\Component\Filesystem\Filesystem;
public function registerCommands(Application $application){
$crudCommand = $application->get('generate:doctrine:crud');
$generator = new DoctrineCrudGenerator(new FileSystem, __DIR__.'/Resources/skeleton/crud');
$crudCommand->setGenerator($generator);
parent::registerCommands($application);
}
आप YourBundle\Resource
को skeleton
फ़ोल्डर की प्रतिलिपि और टेम्पलेट्स को संशोधित करने के लिए है।
स्रोत
2012-04-21 19:58:26
क्या यह इसके बजाय "index.html.twig.twig" एक्सटेंशन नहीं होना चाहिए? डबल "टहन" नोट करें। http://symfony.com/doc/current/bundles/SensioGeneratorBundle/index.html – DevWL