mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-14 14:24:24 +00:00
merge of branch add_acl Squashed commit of the following: commit b112df16e568ad4a305e290b4cca9eb696bcf5d7 Merge: f8c44ca 11324cb Author: Julien Fastré <julien.fastre@champs-libres.coop> Date: Tue Jun 30 09:59:03 2015 +0200 Merge remote-tracking branch 'origin/master' into add_acl commit f8c44ca20b5a53fb18da00ab265d626dd8c770b2 Author: Julien Fastré <julien.fastre@champs-libres.coop> Date: Fri Jun 5 22:47:50 2015 +0200 fix Form signature to match abstractForm OptionsResolverInterface => OptionsResolver commit 586155ecfa85240d683aa8bd37493e948f89cd67 Author: Julien Fastré <julien.fastre@champs-libres.coop> Date: Fri Jun 5 22:47:25 2015 +0200 remove deprecation warnings from phpunit commit 6ada3ddef336b958a886215fcdb040a29f5a411f Author: Julien Fastré <julien.fastre@champs-libres.coop> Date: Fri Jun 5 22:30:30 2015 +0200 replace deprecated setDefaultOptions setdefaultsOptions => configureOptions commit 28b0e258d52b08ecd3799e19b15bd4b1f1e58f83 Author: Julien Fastré <julien.fastre@champs-libres.coop> Date: Fri Jun 5 11:20:30 2015 +0200 fix twig.form.resources deprecations commit cb09035c8f0eb74192f7e3e68c93c6378f158f2f Author: Julien Fastré <julien.fastre@champs-libres.coop> Date: Fri Jun 5 10:58:19 2015 +0200 switch to symfony 2.7 [ci skip]
57 lines
2.1 KiB
PHP
57 lines
2.1 KiB
PHP
<?php
|
|
|
|
namespace Chill\CustomFieldsBundle\DependencyInjection;
|
|
|
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
|
use Symfony\Component\Config\FileLocator;
|
|
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
|
|
use Symfony\Component\DependencyInjection\Loader;
|
|
use Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface;
|
|
|
|
/**
|
|
* 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}
|
|
*/
|
|
class ChillCustomFieldsExtension extends Extension implements PrependExtensionInterface
|
|
{
|
|
/**
|
|
* {@inheritDoc}
|
|
*/
|
|
public function load(array $configs, ContainerBuilder $container)
|
|
{
|
|
$configuration = new Configuration();
|
|
$config = $this->processConfiguration($configuration, $configs);
|
|
|
|
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
|
|
$loader->load('services.yml');
|
|
|
|
//add at least a blank array at 'customizable_entities' options
|
|
//$customizable_entities = (isset($config['customizables_entities'])
|
|
// && $config['customizables_entities'] !== FALSE)
|
|
// ? $config['customizables_entities'] : array();
|
|
|
|
$container->setParameter('chill_custom_fields.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_themes'][] = 'ChillCustomFieldsBundle:Form:fields.html.twig';
|
|
$container->prependExtensionConfig('twig', $twigConfig);
|
|
|
|
//add routes for custom bundle
|
|
$container->prependExtensionConfig('chill_main', array(
|
|
'routing' => array(
|
|
'resources' => array(
|
|
'@ChillCustomFieldsBundle/Resources/config/routing.yml'
|
|
)
|
|
)
|
|
));
|
|
}
|
|
}
|