Skip to content

Commit

Permalink
fix typo in exception message and add some explanation
Browse files Browse the repository at this point in the history
  • Loading branch information
dbu committed Oct 9, 2013
1 parent fcabe73 commit 5c9e512
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion DependencyInjection/CmfRoutingExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,16 @@ private function setupDynamicRouter(array $config, ContainerBuilder $container,
if (!empty($config['templates_by_class'])) {
$dynamic->addMethodCall('addRouteEnhancer', array(new Reference($this->getAlias() . '.enhancer.templates_by_class')));

/*
* The CoreBundle prepends the controller from ContentBundle if the
* ContentBundle is present in the project.
* If you are sure you do not need a generic router, set the field
* to false to disable explicitly. But you would need something
* else to determine the controller in that case, as no controller
* will not be set by the default route enhancers.
*/
if (null === $config['generic_controller']) {
throw new InvalidConfigurationException('If you configure templates_by_class, you need to configure a generic_router. If you are sure you do not need a generic router, set the field to false to disable explicitly.');
throw new InvalidConfigurationException('If you want to configure templates_by_class, you need to configure the generic_controller option.');
}

if (is_string($config['generic_controller'])) {
Expand Down

0 comments on commit 5c9e512

Please sign in to comment.