Skip to content

Commit 94cd062

Browse files
wouterjlsmith77
authored andcommitted
Also prepend RoutingBundle ORM config
1 parent a9e2d9e commit 94cd062

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed

DependencyInjection/CmfCoreExtension.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,24 @@ public function prepend(ContainerBuilder $container)
203203
$prependConfig = array();
204204

205205
switch ($name) {
206+
case 'cmf_routing':
207+
$prependConfig = array(
208+
'dynamic' => array(
209+
'enabled' => true,
210+
'persistence' => array(
211+
'orm' => array(
212+
'enabled' => $persistenceConfig['enabled'],
213+
'manager_name' => $persistenceConfig['manager_name'],
214+
)
215+
)
216+
)
217+
);
218+
219+
if (isset($bundles['CmfContentBundle'])) {
220+
$prependConfig['dynamic']['generic_controller'] = 'cmf_content.controller:indexAction';
221+
}
222+
break;
223+
206224
case 'cmf_seo':
207225
$prependConfig = array(
208226
'persistence' => array(
@@ -212,6 +230,7 @@ public function prepend(ContainerBuilder $container)
212230
),
213231
'sonata_admin_extension' => $persistenceConfig['use_sonata_admin'],
214232
);
233+
break;
215234
}
216235

217236
if ($prependConfig) {

DependencyInjection/Configuration.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,13 @@ public function getConfigTreeBuilder()
4848
->addDefaultsIfNotSet()
4949
->canBeEnabled()
5050
->children()
51+
->scalarNode('manager_name')->defaultNull()->end()
5152
->enumNode('use_sonata_admin')
5253
->values(array(true, false, 'auto'))
5354
->defaultValue('auto')
5455
->end()
5556
->end()
56-
->end()
57+
->end() // orm
5758
->end()
5859
->end()
5960
->arrayNode('multilang')

0 commit comments

Comments
 (0)