mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-24 08:33:49 +00:00
add user
This commit is contained in:
@@ -6,13 +6,14 @@ 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 CLChillMainExtension extends Extension
|
||||
class CLChillMainExtension extends Extension implements PrependExtensionInterface
|
||||
{
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
@@ -25,4 +26,26 @@ class CLChillMainExtension extends Extension
|
||||
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
|
||||
$loader->load('services.yml');
|
||||
}
|
||||
|
||||
public function prepend(ContainerBuilder $container) {
|
||||
$bundles = $container->getParameter('kernel.bundles');
|
||||
|
||||
//Configure FOSUSerBundle
|
||||
if (!isset($bundles['FOSUserBundle'])) {
|
||||
throw new MissingBundleException('FOSUserBundle');
|
||||
}
|
||||
|
||||
$db_driver = array('db_driver' => 'orm');
|
||||
$container->prependExtensionConfig('fos_user', $db_driver);
|
||||
|
||||
$user_class = array('user_class' => 'CL\Chill\MainBundle\Entity\Agent');
|
||||
$container->prependExtensionConfig('fos_user', $user_class);
|
||||
|
||||
$registration_form = array('registration' => array(
|
||||
'form' => array('type' => 'chill_user_registration')));
|
||||
$container->prependExtensionConfig('fos_user', $registration_form);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user