Registre su paquete justo después de SensioGeneratorBundle
en app/AppKernel.php
ej .:
// 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();
Luego, en YourBundle.php
método de reemplazo 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);
}
tienes que copiar skeleton
carpeta para YourBundle\Resource
y modificar plantillas.
¿no debería ser una extensión "index.html.twig.twig" en su lugar? Tenga en cuenta la doble "ramita". http://symfony.com/doc/current/bundles/SensioGeneratorBundle/index.html – DevWL