mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-24 08:33:49 +00:00
loads route automatically
route must now be indicated in config.yml under chill_main.routing.resources. Other bundle may add routes prepending configuration
This commit is contained in:
@@ -28,6 +28,9 @@ class ChillMainExtension extends Extension implements PrependExtensionInterface
|
||||
|
||||
$container->setParameter('chill_main.available_languages',
|
||||
$config['available_languages']);
|
||||
|
||||
$container->setParameter('chill_main.routing.resources',
|
||||
$config['routing']['resources']);
|
||||
|
||||
$loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
|
||||
$loader->load('services.yml');
|
||||
@@ -71,5 +74,15 @@ class ChillMainExtension extends Extension implements PrependExtensionInterface
|
||||
)
|
||||
)
|
||||
));
|
||||
|
||||
//add current route to chill main
|
||||
$container->prependExtensionConfig('chill_main', array(
|
||||
'routing' => array(
|
||||
'resources' => array(
|
||||
'@ChillMainBundle/Resources/config/routing.yml'
|
||||
)
|
||||
|
||||
)
|
||||
));
|
||||
}
|
||||
}
|
||||
|
@@ -30,6 +30,12 @@ class Configuration implements ConfigurationInterface
|
||||
->defaultValue(array('fr'))
|
||||
->prototype('scalar')->end()
|
||||
->end()
|
||||
->arrayNode('routing')
|
||||
->children()
|
||||
->arrayNode('resources')
|
||||
->prototype('scalar')->end()
|
||||
->end()
|
||||
->end()
|
||||
->end();
|
||||
|
||||
return $treeBuilder;
|
||||
|
Reference in New Issue
Block a user