mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-14 06:14:23 +00:00
add form layout to config.yml automatically
This commit is contained in:
parent
568bf4f3c2
commit
f9be8e3412
@ -6,13 +6,14 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
|
|||||||
use Symfony\Component\Config\FileLocator;
|
use Symfony\Component\Config\FileLocator;
|
||||||
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
||||||
use Symfony\Component\DependencyInjection\Loader;
|
use Symfony\Component\DependencyInjection\Loader;
|
||||||
|
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is the class that loads and manages your bundle configuration
|
* This is the class that loads and manages your bundle configuration
|
||||||
*
|
*
|
||||||
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
|
* To learn more see {@link http://symfony.com/doc/current/cookbook/bundles/extension.html}
|
||||||
*/
|
*/
|
||||||
class ChillCustomFieldsExtension extends Extension
|
class ChillCustomFieldsExtension extends Extension implements PrependExtensionInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
@ -33,4 +34,17 @@ class ChillCustomFieldsExtension extends Extension
|
|||||||
$container->setParameter('chill_custom_fields.customizables_entities',
|
$container->setParameter('chill_custom_fields.customizables_entities',
|
||||||
$config['customizables_entities']);
|
$config['customizables_entities']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* (non-PHPdoc)
|
||||||
|
* @see \Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface::prepend()
|
||||||
|
*/
|
||||||
|
public function prepend(ContainerBuilder $container)
|
||||||
|
{
|
||||||
|
// add form layout to twig resources
|
||||||
|
$twigConfig['form']['resources'][] = 'ChillCustomFieldsBundle:Form:form_div_layout.html.twig';
|
||||||
|
$container->prependExtensionConfig('twig', $twigConfig);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user