Creation of DocGenTemplate entity

This commit is contained in:
Marc Ducobu
2021-08-06 15:00:08 +02:00
parent 8207db4b45
commit 7dc501cbda
12 changed files with 291 additions and 11 deletions

View File

@@ -13,7 +13,7 @@ use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
*
* @link http://symfony.com/doc/current/cookbook/bundles/extension.html
*/
class ChillCalendarExtension extends Extension implements PrependExtensionInterface
class ChillDocGeneratorExtension extends Extension implements PrependExtensionInterface
{
/**
* {@inheritdoc}
@@ -33,19 +33,49 @@ class ChillCalendarExtension extends Extension implements PrependExtensionInterf
public function prepend(ContainerBuilder $container)
{
$this->preprendRoutes($container);
$this->prependCruds($container);
}
protected function preprendRoutes(ContainerBuilder $container)
{
$container->prependExtensionConfig('chill_main', [
'routing' => [
'resources' => [
'@ChillDocGeneratorBundle/Resources/config/routing.yml'
]
]
]);
$container->prependExtensionConfig('chill_main', array(
'routing' => array(
'resources' => array(
'@ChillDocGeneratorBundle/Resources/config/routes.yml'
)
)
));
}
/**
* @param ContainerBuilder $container
*/
protected function prependCruds(ContainerBuilder $container)
{
$container->prependExtensionConfig('chill_main', [
'cruds' => [
[
'class' => \Chill\DocGeneratorBundle\Entity\DocGeneratorTemplate::class,
'name' => 'docgen_template',
'base_path' => '/admin/docgen/template',
'form_class' => \Chill\DocGeneratorBundle\Form\DocGeneratorTemplateType::class,
'controller' => \Chill\DocGeneratorBundle\Controller\AdminDocGeneratorTemplateController::class,
'actions' => [
'index' => [
'template' => '@ChillDocGenerator/Admin/DocGeneratorTemplate/index.html.twig',
'role' => 'ROLE_ADMIN'
],
'new' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillDocGenerator/Admin/DocGeneratorTemplate/new.html.twig',
],
'edit' => [
'role' => 'ROLE_ADMIN',
'template' => '@ChillDocGenerator/Admin/DocGeneratorTemplate/edit.html.twig',
]
]
]
]
]);
}
}