When generating a bundle, are TitleCase names valid? For example with Acme\TitleCaseBundle Symfony2 will automatically assume routes are to be prefixed with acme_title_case, services are acme_title_case.example: and in Acme\TitleCaseBundle\DependencyInjection\Configuration, the root node for the configuration tree is found with this method
<?php
// ...
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('acme_title_case');
// ...
}
It’s supposed to be acme_titlecase !
Trying to correct these, then adding acme_titlecase: ~ to app/config/config.yml will throw this error
InvalidArgumentException: There is no extension able to load the configuration for
"acme_titlecase" (in /Users/me/Sites/MySite/app/config/config.yml).
Looked for namespace "acme_titlecase",
found "framework", "another_namespace", ... , "acme_title_case", ...
Thanks to a post by Matthias Noback, the solution is to override
getAlias()method and return whatever you like.